// HACKER NEWS — CYBERSECURITY
TurboKV: Insanely fast Rust key-value store
TurboKV is an async embedded key-value database with atomic batches, ordered
range scans, configurable durability, compression, and background compaction.
TurboKV's persisted Bloom-filter format uses hardware AES. Build x86/x86_64
targets with RUSTFLAGS="-C target-feature=+aes,+sse2", and ARM/AArch64
targets with RUSTFLAGS="-C target-feature=+aes,+neon". You may instead use
-C target-cpu=native when the binary will run only on the same CPU model or a
feature superset.
One open Db or Engine exclusively owns its data directory. Use close() or
close_with_status() for a clean shutdown; dropping a handle is not a clean
shutdown contract.
Keys and values are arbitrary byte sequences supplied through AsRef<[u8]>;
strings need to be encoded by the caller. Mutation APIs copy their inputs before
returning. Point and collecting reads return owned Vec values. An empty
value is valid data and is distinct from a deleted key.
All presets start with a 64 MiB memtable, a 64 MiB block cache, and LZ4
compression. Their public fields can be adjusted before opening:
With the WAL enabled, one record or complete batch must fit in the WAL's
u32 payload length. A failed or cancelled mutation may already have reached
the WAL; inspect the key or reopen before retrying a non-idempotent operation.
Keys are ordered lexicographically by raw bytes. Every scan captures a coherent
point-in-time view. Creating one can freeze a nonempty active memtable, so
frequent small scans may increase later flush work.
Advancing a streaming iterator is synchronous and may perform mmap reads,
checksum validation, decompression, and cache locking. Drop it promptly: the
iterator pins its snapshot readers and database-directory ownership.
Most database methods return DbError. Streaming iterator creation returns
DbError, while failures discovered later are yielded as ScanError. The
lower-level Engine and component configuration types are supported advanced
APIs; their complete field and method contracts are in the
crate documentation.
The benchmark used TurboKV 0.6.0, fjall 2.11.2, and redb 2.6.3 in Durable
mode over three repetitions. Throughput is acknowledged keys per second;
higher is better.