« All posts

ArborDb: a Rust document store with constant-time field reads

ArborDb is a Rust document store using zero-copy, offset-table blobs to give constant-time field reads regardless of record size.

ArborDb is a pure-Rust, transactional, typed document store that stores each value as a single zero-copy blob with offset tables, instead of shredding fields into separate keyed rows. Lists get O(1) index jumps and objects get O(log n) field lookup via a name-sorted offset table, all read directly from the underlying redb engine's page bytes without decoding the whole value.

The design pays off in benchmarks: reading one field out of a 128-field record takes roughly 1.4 µs regardless of record size, while engines that must decode-then-project scale linearly (redb+bincode reaches 12.1 µs at 128 fields and 714 µs on a 10,240-element list). ArborDb is the 1.0 successor to StratoDb, keeping the same typed derive model while replacing per-scalar rows with single-blob-per-value storage.

Beyond the storage model, tables behave like a virtual filesystem (path-based access, mv/cp, persistent opaque keys), support Serde-style derives, secondary indexes with composite ordering, and optional features like ACLs, tamper detection (BLAKE3 + Ed25519), and JSON/YAML export. Tradeoffs are stated plainly: variable-width or structural writes require re-encoding the blob, and bulk inserts into a single directory scale roughly O(N²).

For engineers, this is a concrete example of a storage engine designed around access patterns rather than raw throughput — relevant to anyone building embedded databases, config stores, or systems where partial reads of large documents are common.