cberner/redb
69.0
Adequate · 30 September 2026
40.1k
lines of production code
Rust
primary language
2
measurements over time
What this system is
This system is redb, a high-performance, embedded key-value database engine written in Rust. It provides a robust storage layer featuring MVCC transactions, multi-process concurrency, and persistent savepoints, with an internal architecture optimized for efficient B-tree operations. The project includes comprehensive tooling for development, testing, and fuzzing, alongside Python bindings and derive macros to facilitate integration into various applications.
How it got here
2018–2021 — redb 5.0 architecture and tooling
6 changes.
This period focused on restructuring the project into a Cargo workspace and establishing standardized development tooling, including CI automation and linting. The core effort centered on the redb 5.0 API preview, introducing MVCC transactions, multi-writer support, and a modular B-tree storage architecture. Comprehensive testing was added to verify crash consistency, integrity checks, and transaction aborts, alongside new multi-process locking and storage backends.
2022–2026 — Ecosystem expansion and reliability hardening
10 changes.
This period focused on broadening the project's reach by introducing Python bindings, derive macros for ergonomic API usage, and a comprehensive benchmarking infrastructure for cross-engine comparison. Concurrently, significant effort was dedicated to stability and safety through the implementation of platform-specific file locking, fuzz testing for crash recovery, and sandboxed execution environments.
Features
Added derive macros for redb Key and Value traits
The \redb-derive\ crate introduces \\#\[derive(Key)\]\ and \\#\[derive(Value)\]\ macros for structs, automatically generating the necessary trait implementations to serialize and deserialize data in the redb database. The generated code uses fully qualified paths to avoid shadowing issues and supports custom crate naming via the \\#\[redb(crate = "...")\]\ attribute, allowing users to derive these traits even when the redb dependency is renamed or when multiple versions are present.
crates/redb-derive/src · high confidence
Initial Python bindings for redb database and write transactions
The redb Python package is now available, exposing \Database.create()\ to open or create a database file and \Database.begin\_write()\ to start a write transaction. Write transactions support the Python context manager protocol (\with\ statement), automatically committing on success and aborting if an exception occurs. A comprehensive set of Python exceptions (e.g., \DatabaseError\, \StorageError\, \TransactionError\) is provided to map underlying redb errors to Python types.
crates/redb-python · high confidence
Introduce multi-process locking protocol and new storage backends
The page store now supports multi-process concurrency through a new active transaction locking protocol that uses file-range locks to coordinate read and write access across processes. This is accompanied by the addition of new storage backends, including an in-memory backend for testing and a read-only wrapper, allowing the database to operate without standard library dependencies or to be used in embedded scenarios.
_src/tree\_store/page\store · high confidence
Introduce redb 5.0 API preview with MVCC, savepoints, and multi-writer support
This release introduces the redb 5.0 API preview, bringing significant architectural changes including MVCC transactions for concurrent readers and writers, persistent savepoints with rollback capabilities, and multi-writer support. The file format has been updated to version 3, and the API now exposes new types such as ReadTransaction, WriteTransaction, and Savepoint. Users can now open read-only databases, use range queries with KeyRange, and benefit from improved performance through optimized btree operations and dynamic database file growth. The legacy types module provides migration paths for existing databases, and the error handling has been refined with more granular error types.
src · high confidence
New benchmarking infrastructure for redb and comparison engines
The repository has been restructured into a Cargo workspace, introducing a new \redb-bench-compare\ crate that isolates native dependencies for external database engines (LMDB, RocksDB, Fjall, SQLite) from the core \redb-bench\ crate. This new infrastructure provides a unified \BenchDatabase\ adapter interface, enabling direct performance comparisons of redb against these engines across standardized workloads including bulk loads, large-value inserts, multithreaded inserts, and savepoint operations.
crates/redb-bench · high confidence
New examples demonstrating derived keys, integer keys, multithreading, and out-of-band values
Added four new example files to the examples directory: derive\_value\_impl.rs shows how to use the derive macro for custom Key and Value types; int\_keys.rs demonstrates basic usage with integer keys; multithread.rs illustrates concurrent read and write access using Arc\<Database\> and multiple threads; and special\_values.rs provides a pattern for storing large or special-value data in sidecar files while keeping references in the database.
examples · high confidence
New sandboxed execution script for tests and benchmarks
A new script, scripts/podman-sandbox.sh, has been added to allow running commands (such as tests or benchmarks) inside a secure, isolated Podman container. This script builds a sandbox image using the Rust version specified in rust-toolchain and executes the provided command with strict security constraints, including a private network, read-only filesystem, dropped capabilities, and no new privileges, ensuring that build artifacts are stored in a dedicated volume.
scripts · high confidence
Architecture
Refactor tree storage into modular B-tree components
The internal tree storage implementation has been reorganized into distinct modules (btree, btree\_base, btree\_cursor, btree\_cursor\_range, btree\_iters, btree\_mutator, extract\_if) to improve code structure and maintainability. This change introduces new abstractions like BtreeCursorRange for efficient range iteration and BtreeExtractIf for conditional removal, while encapsulating leaf and branch page mutations behind dedicated wrappers. Users benefit from a more robust and optimized underlying storage engine that supports advanced cursor operations and better memory management.
_src/tree\store · high confidence
Behavioural changes
Introduce platform-specific file locking with a fallback for unsupported systems
The file backend now uses native byte-range locking on Windows, Linux, and macOS to support concurrent access, while providing a fallback implementation for other platforms that only supports whole-file locking. This change ensures reliable multi-process safety on supported operating systems and graceful degradation on others.
_src/tree\_store/page\_store/file\backend · high confidence
Support for renamed redb crate dependency in derived code
The derive macros now correctly handle scenarios where the redb library is imported under a different name (e.g., \renamed\_redb\). By using the \\#\[redb(crate = "...")\]\ attribute, generated implementations for \Key\ and \Value\ traits resolve paths relative to the specified crate name, ensuring that derived code compiles and functions correctly even when the dependency is not available under the default \redb\ identifier.
crates/redb-derive-rename-test · high confidence
Test coverage
Add no-std test crate for redb; Added tests for derive macro correctness and multi-version compatibility; Expanded test coverage for transaction aborts, integrity checks, and crash recovery; New comprehensive fuzzer harness for redb.
Dependencies
Redb 4.3.0 workspace and dependency updates
Redb is updated to version 4.3.0 and restructured as a Cargo workspace, introducing dedicated crates for benchmarks (redb-bench, redb-bench-compare), derive macros (redb-derive), Python bindings (redb-python), and fuzzing (fuzz). The project now targets Rust edition 2024 with a minimum supported Rust version (MSRV) of 1.90. Key dependency updates include pyo3 to 0.29.0 for Python bindings, rand to 0.10.1 across benchmarks and fuzzing, and specific benchmark engines like rocksdb (0.24.0), heed (0.22), and fjall (3.1.6). The Python bindings are now packaged via maturin with pytest-based testing, and the core library supports optional chrono and uuid features.
(dependencies) · high confidence
Housekeeping
Repository development environment and tooling setup
The repository now includes standardized configuration and automation files to streamline development and CI. A \justfile\ replaces the previous Makefile, providing targets for building, testing, fuzzing, and benchmarking (including containerized benchmarks). Development is supported by \.editorconfig\ for consistent formatting, \clippy.toml\ and \rustfmt.toml\ for linting and style enforcement, and \deny.toml\ for license and security advisory checks via \cargo-deny\. The Rust toolchain is pinned to version 1.90 via \rust-toolchain\. Containerized build and benchmark environments are defined in \Containerfile.sandbox\ and \Dockerfile.bench\. Additionally, \AGENTS.md\ and \CLAUDE.md\ provide instructions for coding agents, and the license files have been split into \LICENSE-APACHE\ and \LICENSE-MIT\.
(repo-wide) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 72 → 69 (-2.9)
- Rubric changed (rubric-2026.09.11 → rubric-2026.09.18) — scores are not directly comparable.
Lenses
- Code Health 88 → 88 (+0.1)
- Architecture 100 → 99 (-1.3)
- Maturity 60 → 60 (-0.0)
- Readiness 74 → 70 (-3.3)
- Security 85 → 79 (-6.3)
- Performance 80 (new)
Resolved (4)
- Documentation: no contributor guidance (README.md)
- Documentation: no installation or build instructions (README.md)
- Documentation: no usage examples (README.md)
- Members sharing a duplicated core (4 members, 50+ identical tokens) (src/table.rs)
New (7)
- ClassTooLong: PagedCachedFile (src/tree_store/page_store/cached_file.rs)
- Dependency hygiene PARTLY measured — Cargo dependencies read, no committed lock to grade for currency
- End-of-life runtime: Rust 1.90
- Inconsistent naming and parameterization for range queries. ReadableMultimapTable uses range for both KeyRange and RangeBounds, while ReadOnlyMultimapTable distinguishes between range (RangeBounds) and range_owned (KeyRange). Additionally, ReadOnlyMultimapTable has range_owned for both KeyRange and RangeBounds, creating ambiguity on whether the suffix denotes ownership or key type.
- Members sharing a duplicated core (4 members, 50+ identical tokens) (src/table.rs)
- Off the main sequence: redb
- Same inconsistency as MultimapTable: ReadableTable uses range for both KeyRange and RangeBounds, while ReadOnlyTable uses range for RangeBounds and range_owned for both KeyRange and RangeBounds. This creates a confusing split where the same operation name (range) behaves differently depending on the trait implementation and parameter type.
Changes since last survey
- 30 commits — 30 feature/other, 0 fixes
By area
- (root) — 14 commits
- src/tree_store — 9 commits
- src/db.rs — 2 commits
- .github/workflows — 1 commit
- crates/redb-derive — 1 commit
- src/error.rs — 1 commit
- src/key_range.rs — 1 commit
- src/tuple_types.rs — 1 commit
Notable commits
- change: Add Legacy<T>, a type without its niche, behind a feature flag
- change: Add Value::NICHE, an encoding a type never produces
- change: Bump version to 4.3.0
- change: CI: key the build cache on the resolved lockfiles
- change: Compile syncing to a peer's commit without experimental-multiprocess
- change: Compile the active transaction bytes without experimental-multiprocess
- change: Compile the header lock without experimental-multiprocess
- change: Compile the open protocol without experimental-multiprocess
- change: Compile the writer lock without experimental-multiprocess
- change: Drop the lifetime parameter from KeyRange
- change: Encode Option<T> without a tag when T declares a niche
- change: Forward the element's niche through (T,)
- change: Forward the field's niche through single-field derived structs
- change: Gate multiprocess error variants behind their feature
- change: Give &str a niche, under the experimental-niches feature
- change: Give String a niche, under the experimental-niches feature
- change: Give bool a niche, under the experimental-niches feature
- change: Give char a niche, under the experimental-niches feature
- change: Implement Value and Key for the NonZero integer types
- change: Invalidate cached pages beyond EOF when shrinking
- …and 10 more
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
cberner/redb was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 30 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 207c6f2343e46f900534a60cb39becc332e3dc1a — the exact code this score is about.
- Scored under rubric-2026.09.18 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-cb25ca4feafa.