Expand description
novakv — an embedded, ordered key-value store. Crate root.
The headline entry point is db_impl::DBImpl — open a DB, run
put / get / delete / write / new_iterator /
get_snapshot. Most callers only need prelude.
§Layout
Each public module is a focused layer of the storage engine. Every
module’s //! doc explains what’s there and when to reach for it.
| Module | What’s in it |
|---|---|
coding | varint + fixed-LE primitives |
status | Status, Code, Result |
hash | non-cryptographic 32-bit hash |
crc32c | CRC32C + masked variant |
comparator | Comparator trait + BytewiseComparator |
format | internal-key format, level constants |
write_batch | WriteBatch, WriteBatchHandler |
block | data-block builder + reader |
filter | FilterPolicy + BloomFilterPolicy |
filter_block | per-block filter index |
two_level_iter | index-of-blocks iterator |
merging_iter | k-way merge iterator |
table | SSTable builder + reader + Compressor |
log | WAL writer + reader |
skiplist | lock-free skiplist |
memtable | in-memory write buffer |
filename | DB-directory file naming |
env | filesystem trait + StdEnv + MemEnv |
cache | Cache trait + ShardedLRUCache |
table_cache | open-Table cache |
version_set | LSM level metadata + manifest |
db_impl | DBImpl, Options, ReadOptions, WriteOptions |
db_iter | snapshot-aware iterator |
repair | reconstruct a damaged DB |
destroy | delete a DB directory |
slice | (ptr, len) byte view |
§Quickstart
use novakv::prelude::*;
let env = MemEnv::new();
let db = DBImpl::open("/db", env, BytewiseComparator, Options::default()).unwrap();
db.put(b"hello", b"world").unwrap();
assert_eq!(db.get(b"hello").unwrap(), Some(b"world".to_vec()));See db_impl for the full API surface and tuning knobs.
Re-exports§
pub use db_iter::DbIterator;pub use comparator::BytewiseComparator;pub use comparator::Comparator;pub use format::InternalKey;pub use format::InternalKeyComparator;pub use format::LookupKey;pub use format::ParsedInternalKey;pub use format::SequenceNumber;pub use format::ValueType;pub use format::MAX_SEQUENCE_NUMBER;pub use format::VALUE_TYPE_FOR_SEEK;pub use status::Code;pub use status::Result;pub use status::Status;pub use write_batch::WriteBatch;pub use write_batch::WriteBatchHandler;pub use write_batch::WriteBatchRecord;
Modules§
- block
- Prefix-compressed key-value block.
- cache
- Generic refcounted LRU cache.
- coding
- Fixed-width and varint primitives for on-disk byte layouts.
- comparator
- Total order over user keys.
- crc32c
- CRC32C with the Castagnoli polynomial.
- db_impl
DBImpl— the database handle, plus public option structs.- db_iter
- Snapshot-aware DB iterator.
- destroy
- Delete an entire DB directory.
- env
- Filesystem abstraction.
- filename
- DB-directory file-naming helpers.
- filter
- Probabilistic key-presence filter.
- filter_
block - Per-data-block filter index.
- format
- Internal-key format and LSM-level constants.
- hash
- Non-cryptographic 32-bit hash.
- log
- Write-ahead log.
- memtable
- In-memory write buffer.
- merging_
iter - K-way merge over multiple sorted iterators.
- prelude
- Public-API surface. An embedder typically only needs the items in
this prelude — concrete types for opening / using / closing a
database, plus the trait that abstracts over
DBImpl. - repair
- DB repair utility.
- skiplist
- Lock-free reads, single-writer skiplist.
- slice
- Lightweight
(ptr, len)borrowed-bytes view. - status
- Engine-wide error type.
- table
- On-disk SSTable: builder, reader, and the
Compressortrait. - table_
cache - Open-Table cache.
- two_
level_ iter - Two-level iterator: index iterator over data-block iterators.
- version_
set - LSM level metadata + manifest log.
- write_
batch - Atomic batched writes.