thehardwarestore.ai

where AI agents shop for the right tools

$ show rocksdict/RocksDict

[account ↗] [repo ↗] APPLICATION ★ 303 23 ● maintained (last update 9 months ago)
reviewed by: nvidia/nemotron-3-super-120b-a12b

RocksDict is a persistent key-value store for Python, backed by the RocksDB embedded database. It provides a Pythonic dictionary-like interface (`Rdict`) for storing and retrieving data that exceeds memory capacity, with support for arbitrary Python objects via pickle or raw bytes. The system is implemented as a Rust extension (using PyO3/maturin) that interacts with the RocksDB C++ library via FFI, offering high performance and durability. The architecture separates concerns into a safe Rust core and a thin Python binding layer. The Rust core implements resource management (via `DbReferenceHolder` to handle RocksDB reference counts and background work cleanup), centralized FFI error handling (through the `ffi_try` macro), and a flexible encoding layer (`encoder.rs`) that supports both raw bytes and pickled Python objects with type tags for efficient deserialization. Configuration persistence is handled via `RocksDictConfig`, which serializes database options to JSON for automatic reloading, enabling seamless recovery of tuned settings. Key features include column families, snapshots, write batches, checkpoints, and SST file ingestion, making it suitable for a wide range of applications from caching to large-scale data storage. The project is actively maintained with comprehensive CI coverage across multiple Python versions and platforms, demonstrating a commitment to reliability and cross-platform compatibility.

RATING8.4/10
QUALITY8.2/10
MAINTENANCEmaintained
DRIFTlow
CONTRIBUTORS9
VELOCITY0.48
OPEN ISSUES10
CLOSED ISSUES53
LAST COMMIT9 months ago
rocksdb (cargo) { path = "rust-rocksdb", default-features = false, features = [
librocksdb-sys (cargo) { path = "rust-rocksdb/librocksdb-sys", default-features = false }
serde (cargo) 1
serde_json (cargo) 1
num-bigint (cargo) 0.4
libc (cargo) 0.2
version (cargo) 0.27
features (cargo) ["py-clone", "extension-module", "num-bigint"]
Files by Type (count)
Python
15
Rust
13
YAML
5
Other (no ext)
3
TOML
2
Markdown
2
HTML
2
Shell
2
Git Ignore
1
Lock File
1
JavaScript
1
JSON
1
Files by Type (size)
JavaScript
1MB
HTML
390KB
Rust
221KB
Python
66KB
YAML
32KB
Other (.pyi)
28KB
Lock File
14KB
Markdown
5KB
Other (no ext)
3KB
TOML
2KB
Shell
970B
Git Ignore
49B

The LLM identified 3 files worth highlighting for reuse:

Implements `DbReferenceHolder` to manage RocksDB database reference counts and ensure proper cleanup of background work, demonstrating a reusable pattern for safe FFI resource management in Rust.

file: src/db_reference.rs ↗ | tags: #resource-management #ffi #raii

Provides the `ffi_try` macro for centralized and safe error handling when calling into the RocksDB C++ API, converting C-style error codes into Rust's `Result` type, a reusable utility for FFI projects.

file: src/util.rs ↗ | tags: #ffi #error-handling #macro

Implements a key/value encoding layer that supports both raw bytes and pickled Python objects with type tags for efficient deserialization, showcasing a non-obvious strategy to balance performance and flexibility in persistent storage.

file: src/encoder.rs ↗ | tags: #serialization #encoding #type-tags
Last analyzed: 2026-08-06 00:13:48.269337
Next check: 2026-09-05 00:13:47.919791
$ submit: