Crate holt
Expand description
§holt — adaptive radix tree metadata storage engine
holt is an embedded Rust library that stores path-shaped
metadata with sub-microsecond lookups, per-blob concurrency,
and crash-safe persistence. It is built around an Adaptive
Radix Tree that spans multiple 512 KB blob frames.
See README.md for the elevator pitch and ARCHITECTURE.md
for the deep dive.
§Current status
All core layers — layout, walker (insert / lookup / erase /
range / spillover / compact / merge), persistent store
(O_DIRECT + optional io_uring), WAL with replay, sharded
buffer manager, background checkpointer — are in place and
covered by integration + property tests. See ROADMAP.md
for the post-0.3 direction.
§Quick taste
use holt::{RangeEntry, TreeBuilder};
let tree = TreeBuilder::new("/var/lib/myapp/meta.holt").open()?;
tree.put(b"img/01.jpg", b"rgb_data")?;
let v: Vec<u8> = tree.get(b"img/01.jpg")?.unwrap();
for entry in tree.scan(b"img/").into_iter().take(10) {
if let RangeEntry::Key { key, value, .. } = entry? {
println!("{key:?} -> {value:?}");
}
}§Module map
The supported import surface is the flat crate root:
Tree, TreeBuilder, AtomicBatch, Record,
RecordVersion, View, range iterator types, stats
snapshots, and the optional metrics renderer.
All implementation modules are crate-private. This keeps the on-disk format, WAL codec, walker, and buffer-manager internals free to change in minor releases without breaking downstream code.
Internal modules (pub(crate), not part of the SemVer surface):
layout— extern struct layouts (BlobHeader, SlotEntry, per-NodeType bodies). Pinned at compile time viaconst _: () = assert!(...)blocks per file.journal— WAL codec + replay scanner + writer.store— buffer manager + blob-frame allocator + store trait machinery. The supported store surface (BlobStore,MemoryBlobStore,FileBlobStore,AlignedBlobBuf) is re-exported at the crate root for users who want to plug in a custom store.engine— recursive walker (insert / lookup / erase / scan / rename / compact). Record and key-only range iterator types and stats snapshots are re-exported at the crate root.concurrency—HybridLatch3-mode lock plus the tree-wide maintenance gate.checkpoint— 3-thread background checkpointer. Users opt in viaCheckpointConfig.
§Platform support
holt is Unix-only by design: Linux (O_DIRECT fast path,
io_uring on the file store) and macOS (F_NOCACHE).
Windows is out of scope and the crate refuses to compile there
— see the platform stance in ROADMAP.md.
Structs§
- Aligned
Blob Buf - A heap-allocated, 4 KB-aligned,
PAGE_SIZE-byte buffer. - Atomic
Batch - Builder for an atomic batch. See
super::tree::Tree::atomic. - Blob
Stats - Per-blob counters captured by
Tree::stats. - Checkpoint
Config - Background checkpointer policy + cadence.
- Checkpointer
Stats - Snapshot of the background checkpointer’s accumulated
counters. Returned inside
TreeStats::checkpointerwhen the thread group is enabled. All counters are cumulative since the threads were spawned. - File
Blob Store - NVMe-backed, O_DIRECT, single-packed-file blob store.
- Journal
Stats - Snapshot of the WAL group-commit worker’s counters.
- KeyRange
Builder - Builder produced by
crate::Tree::range_keys. - KeyRange
Iter - Active key-only iteration state — see
KeyRangeBuilder::into_iter. - Memory
Blob Store - Concurrent in-memory blob store.
- Range
Builder - Builder produced by
crate::Tree::range. - Range
Iter - Active iteration state — see
RangeBuilder::into_iter. - Record
- Value plus the live record version observed by one lookup.
- Record
Version - Opaque per-record version returned by
Tree::get_version. - Route
Cache Stats - Root-route-cache counters captured by
Tree::stats. - Tree
- An
holttree — your handle to one metadata store. - Tree
Builder - Fluent constructor for
Tree. - Tree
Config - Configuration passed to
crate::Tree::open. - Tree
Stats - Tree-wide aggregate counters from
Tree::stats. - View
- Immutable read transaction over one captured prefix.
- View
KeyRange Builder - Key-only range builder scoped to a
View. - View
Range Builder - Record range builder scoped to a
View.
Enums§
- Error
- Top-level error type covering the union of every failure mode.
- KeyRange
Entry - An entry yielded by
KeyRangeIter. - KeyRange
Entry Ref - Borrowed key-only range entry passed to
KeyRangeBuilder::visit. - Range
Entry - An entry yielded by
RangeIter. - Storage
- Where the tree’s data lives.
- WalCommit
- Commit acknowledgement boundary for file-backed WAL writes.
Traits§
- Blob
Store - A blob-granular storage interface.