Itzma: Vector Search on Object Storage, Without a Server
This is a personal project and the code is public on GitHub. It’s dual-licensed MIT or Apache-2.0, and there’s a site at itzma.dev.
- Problem
- Vector search usually sits behind a server that owns the data. I wanted to see how far a bucket alone could go: any process that can reach it can write, and any process can query.
- Constraints
- No server, lock service or leader between callers and data. Correctness can only lean on what the object store already guarantees. Queries have to work when every read is a network request.
- Decisions
- Writes are immutable log objects created with put-if-absent. One manifest object changes only by conditional update. Segments are byte-for-byte reproducible, so racing compactors can't publish different answers. Indexes are optional and always reranked on exact vectors.
- Tradeoffs
- Plain writes are at-least-once, and exactly-once needs keyed writes. Local disk has no conditional update, so it can't compact. In Rust, compaction and indexing are explicit calls and the library starts no background task.
- Evidence
- Recall@10 of 0.987 (HNSW, 32 segments) and 0.99 or more (SQ8, default settings) on SIFT1M and GloVe-25. Those are the only two datasets measured. The tests also run against MinIO to check that conditional writes stay atomic under concurrent writers.
Itzma is out. It does vector search on top of object storage: your vectors live as plain objects in a bucket, and nothing sits between your code and that bucket. It’s written in Rust and has Python bindings. The current release is 0.3.0.
It’s a library, not a service. You open a namespace in your own process, and S3, a local directory or memory holds the data. If two processes open the same namespace, they see the same data.
Try it
In Python:
pip install itzma import itzma
from itzma import attr
store = itzma.Store("memory://") # or "file:///var/lib/itzma", "s3://bucket/prefix"
schema = itzma.Schema(dim=3, metric=itzma.Metric.COSINE, attrs={"year": itzma.AttrType.NUMBER})
ns = itzma.Namespace.create(store, "articles", schema)
ns.upsert([
{"id": "intro", "vector": [0.9, 0.1, 0.0], "attrs": {"year": 2024}},
{"id": "faq", "vector": [0.0, 1.0, 0.2], "attrs": {"year": 2021}},
])
hits = ns.query([1.0, 0.0, 0.0], top_k=2, filter=attr("year") >= 2022)
print(hits.ids, hits.distances) In Rust, add itzma-core from crates.io. The README has the full tour.
What it leans on
The design rests on two operations that object stores already have: put-if-absent (“create this key, fail if it exists”) and conditional update (“overwrite this only if it still looks like it did when I read it”).
Itzma runs inside your process. Writes go down to the bucket, reads come back up.
Every write is one immutable object in a log, created with put-if-absent at the next sequence number. If another writer got there first, yours looks past it and tries the next number. After 32 lost races in a row it stops with an error and nothing written. There’s no coordinator and no lock.
Only one object is ever overwritten: the manifest. It lists the live segments, how far the log has been folded into them, and which segments have an index. Every change to it is a compare-and-swap, retried on fresh contents.
That’s enough to keep the promises the README makes. A write that returned is in the store. A query that starts after it sees it. Readers see a whole batch or none of it, and they see entries 1 through n, never a later entry without an earlier one. The write path post walks through how.
What a query does
A query reads the segments plus the log entries that haven’t been folded in yet. Each source proposes candidates, anything a newer source overwrote or deleted gets dropped, and the survivors are rescored against their exact vectors. So the distances you get back are exact, with an index or without.
A namespace fixes a dimension and a metric (L2, cosine or dot product). Attributes are typed and declared up front, and a filter can stand alone or narrow a vector query. A document can also carry a sparse vector next to the dense one, with an exact sparse query and an optional inverted index.
There are two kinds of dense index. HNSW is the default and fetches a segment’s index in one request. SQ8 reads only the partitions a query probes. Which one is better depends on whether your reads are cached, and the index post goes into it.
Who cleans up
Nothing in the log gets rewritten, so something has to fold it into
segments and delete what’s been replaced. Compaction folds the tail into a
new segment, or merges segments when there are too many. Garbage collection
removes replaced segments once they’re old enough that a reader holding an
older manifest has finished. maintain does both, and it’s the one call to
schedule.
A segment’s bytes depend only on the range of log entries it covers. If a compactor dies halfway and another reruns the work, the same object comes out. If two race, they can’t publish different answers. That’s why a query returns the same documents before, during and after a compaction.
In Python you don’t have to schedule anything: opening a namespace starts a maintenance loop. Processes sharing a namespace agree on one maintainer through a lease, which is a single object in the bucket. The lease saves work and decides nothing about correctness, since two maintainers at once were always safe.
There’s also a read-only health report that lists what a namespace holds and what looks wrong, and a recovery call that rebuilds a lost manifest from the schema, the segment names and the log.
Keeping reads cheap
On object storage a read is a request, and requests cost time and money, so the library puts limits on them. Every query attempt has a byte budget, 1 GiB by default, and past it the call fails before anything is written. A cache holds byte ranges in RAM and optionally on NVMe. Objects never change once written, so the cache only evicts and never has to invalidate. The manifest is never cached, so by default a query sees every write that landed before it.
If you’d rather trade freshness for fewer requests, a handle can reuse its last view of the manifest for a set time. An opt-in gate also caps the requests and bytes in flight. Its default limits are starting points. I haven’t measured them under real latency.
What it can’t do yet
- Without an index, or with
exactset, a query reads every live vector in the unindexed segments, bounded only by the read budget. - A clustered index is approximate, and recall has only been measured on SIFT1M and GloVe-25.
- A plain write can land twice if the acknowledgement gets lost. Keyed writes prevent that, though not two submits of one key at the same moment.
- One batch is one object, at most 64 MiB. Each batch is atomic, but a larger load split across batches isn’t.
- Vector queries don’t paginate, and attribute fields can’t be added after creation.
- Local disk has no conditional update. You can create, write and query there, but compaction, indexing and upgrades fail.
Adapters for Google Cloud Storage, Azure Blob Storage and S3 wrap the vendors’ own Rust SDKs, and a conformance suite checks that a store does what Itzma relies on. I’d rather call a store supported because it passes that suite than because it’s on a list.
If you try it and something breaks or surprises you, open an issue on GitHub.