RockSolid is a Rust persistence layer on top of RocksDB, the embedded key-value store. It wraps the raw bindings in typed stores so you work with Rust keys and serde values instead of byte slices. Values are serialized with MessagePack and keys go through an AsBytes trait.
Column families are first class. RocksDbCFStore exposes the full API for any named column family, while RocksDbStore covers the common case where you only need the default one. Both share the CFOperations and DefaultCFOperations traits, so moving from one to the other does not change how reads and writes look.
For atomic work you pick the transaction model that fits. Pessimistic stores (RocksDbTxnStore, RocksDbCFTxnStore) lock across column families through a TransactionContext that rolls back when it is dropped. Optimistic stores (RocksDbOptimisticTxnStore, RocksDbCFOptimisticTxnStore) give you a builder that runs a closure against a snapshot, detects conflicts and retries under a RetryPolicy you can replace. A BatchWriter groups puts, deletes and merges on a single column family.
RockSolid also routes RocksDB's lower-level hooks by key pattern. MergeRouterBuilder sends merges to different handlers and CompactionFilterRouterBuilder can drop, keep or rewrite values during compaction. Paired with ValueWithExpiry<T>, that gives you TTLs that clean themselves up. TuningProfile presets cover workloads like LatestValue, TimeSeries, MemorySaver and RealTime. A callback lets you set any rocksdb::Options directly.
Version 3 builds on rust-rocksdb 0.51 (RocksDB 11.1.2), which is re-exported as rocksolid::rocksdb. It needs Rust 1.91, a C++20 compiler and libclang.
[]
= "3"
= { = "1.0", = ["derive"] }Licensed under MPL-2.0. Source at https://github.com/excsn/rocksolid and API docs at https://docs.rs/rocksolid.
