You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+19-25Lines changed: 19 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,33 +11,23 @@
11
11
12
12

13
13
14
-
SatoriDB runs entirely in-process on a single node. It uses a **two-tier search** architecture:
14
+
SatoriDB is a two-tier search system: a small "hot" index in RAM routes queries to "cold" vector data on disk. This lets us handle billion-scale datasets without holding everything in memory.
15
15
16
-
1.**Routing (HNSW)**: A quantized HNSW index over bucket centroids finds the most relevant clusters in O(log N)
17
-
2.**Scanning (Workers)**: CPU-pinned Glommio executors scan selected buckets in parallel using SIMD-accelerated L2 distance
16
+
**Routing (Hot Tier)**
18
17
19
-
We use a variant of [SPFresh](https://arxiv.org/pdf/2410.14452), Vectors are organized into **buckets** (clusters of similar vectors). A background rebalancer automatically splits buckets via k-means when they exceed a threshold, keeping search efficient as data grows. All data is persisted to walrus high performance storage engine and we use RocksDB indexes for point lookups.
18
+
Quantized HNSW index over bucket centroids. Centroids are scalar-quantized (f32 → u8) so the whole routing index fits in RAM even at 500k+ buckets. When a query comes in, HNSW finds the top-K most relevant buckets in O(log N). We only search those, not the entire dataset.
20
19
21
-
See [docs/architecture.md](docs/architecture.md) for detailed documentation including:
22
-
- System overview and component diagrams
23
-
- Two-tier search architecture
24
-
- Storage layer (Walrus + RocksDB)
25
-
- Rebalancer and clustering algorithms
26
-
- Data flow diagrams
20
+
**Scanning (Cold Tier)**
27
21
28
-
```
29
-
SatoriHandle ──▶ Router Manager ──▶ HNSW Index (centroids)
30
-
│ │
31
-
│ ┌─────────────────────────┘
32
-
│ ▼
33
-
│ Bucket IDs ──▶ Consistent Hash Ring
34
-
│ │
35
-
▼ ▼
36
-
Workers ◀──────────────── bucket_id → shard
37
-
│
38
-
▼
39
-
Walrus (storage) + RocksDB (indexes)
40
-
```
22
+
CPU-pinned Glommio workers scan selected buckets in parallel. Shared-nothing: each worker has its own io_uring ring, LRU cache, and pre-allocated heap. No cross-core synchronization on the query path. SIMD everywhere: L2 distance, dot products, quantization, k-means assignments all have AVX2/AVX-512 paths. Cache misses stream from disk without blocking.
23
+
24
+
**Clustering & Rebalancing**
25
+
26
+
Vectors are grouped into buckets (clusters) via k-means. A background rebalancer automatically splits buckets when they exceed ~2000 vectors, keeping bucket sizes predictable. Predictable sizes = predictable query latency. Inspired by [SPFresh](https://arxiv.org/pdf/2410.14452).
27
+
28
+
**Storage**
29
+
30
+
Walrus handles bulk vector storage (append-only, io_uring, topic-per-bucket). RocksDB indexes handle point lookups (fetch-by-id, duplicate detection). See [docs/architecture.md](docs/architecture.md) for the full deep-dive.
41
31
42
32
## Features
43
33
@@ -63,7 +53,11 @@ cargo add satoridb
63
53
usesatoridb::SatoriDb;
64
54
65
55
fnmain() ->anyhow::Result<()> {
66
-
letdb=SatoriDb::open("my_app")?;
56
+
letdb=SatoriDb::builder("my_app")
57
+
.workers(4) // Worker threads (default: num_cpus)
58
+
.fsync_ms(100) // Fsync interval (default: 200ms)
59
+
.data_dir("/tmp/mydb") // Data directory
60
+
.build()?;
67
61
68
62
db.insert(1, vec![0.1, 0.2, 0.3])?;
69
63
db.insert(2, vec![0.2, 0.3, 0.4])?;
@@ -150,4 +144,4 @@ cargo build --release
150
144
151
145
See [LICENSE](LICENSE).
152
146
153
-
> **Note**: SatoriDB is in early development (v0.1.0). APIs may change between versions. See [CHANGELOG.md](CHANGELOG.md) for release notes.
147
+
> **Note**: SatoriDB is in early development (v0.1.1). APIs may change between versions. See [CHANGELOG.md](CHANGELOG.md) for release notes.
0 commit comments