Skip to content
CAI
Software that uses CAICheck a score

cberner/redb

71.5

Strong · 14 November 2026

44.9k

lines of production code

Rust

primary language

5

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

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

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/benches · 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

1 commit (0 fixes) modifying crates/redb-bench-compare

A change to existing behaviour in crates/redb-bench-compare — 1 commit, 6 files: “Split the benchmarks that compare against other engines into their own crate”.

crates/redb-bench-compare · medium confidence · unverified

1 commit (0 fixes) modifying crates/redb-derive

A change to existing behaviour in crates/redb-derive — 1 commit, 3 files: “Ship the license texts and a README in the redb-derive package”.

crates/redb-derive · medium confidence · unverified

10 commits (0 fixes) modifying crates/redb-python

A change to existing behaviour in crates/redb-python — 10 commits, 5 files: “redb-python: README, redb.open() and package metadata”; “redb-python: declare the license in the package metadata”; “redb-python: describe the tables without calling them dict-like”; and 7 more.

crates/redb-python · medium confidence · unverified

2 commits (0 fixes) modifying crates/redb-python/python

A change to existing behaviour in crates/redb-python/python — 2 commits, 1 file: “redb-python: keep builtins' names out of \_\all\\”; “redb-python: add \\version\\_”.

crates/redb-python/python · medium confidence · unverified

3 commits (0 fixes) modifying crates/redb-bench/src

A change to existing behaviour in crates/redb-bench/src — 3 commits, 1 file: “Convert repo to a Cargo workspace”; “Split the benchmarks that compare against other engines into their own crate”; “Fold extract\_from\_if() into extract\_if() under experimental-api-5”.

crates/redb-bench/src · medium confidence · unverified

40 commits (0 fixes) modifying crates/redb-python/src

A change to existing behaviour in crates/redb-python/src — 40 commits, 7 files: “redb-python: README, redb.open() and package metadata”; “redb-python: commit and abort explicitly, and open an existing database”; “redb-python: a change to a table ends the iterations over it”; and 37 more.

crates/redb-python/src · medium confidence · unverified

5 commits (0 fixes) modifying crates/redb-no-std-test

A change to existing behaviour in crates/redb-no-std-test — 5 commits, 3 files: “Make ReadOnlyDatabase available without std”; “Remove redb::io, and make the Io error variants require std”; “Make the redb-derive implementations work in no\_std crates”; and 2 more.

crates/redb-no-std-test · medium confidence · unverified

6 commits (1 fix) modifying src/types

A change to existing behaviour in src/types — 6 commits (1 fix), 2 files: “Add Key & Value impl for Uuid as optional feature”; “Import core and alloc paths instead of std”; “Add owned accessors that keep the read transaction alive”; and 3 more.

src/types · medium confidence · unverified

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

39 commits adding/updating tests in crates/redb-python/test; 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 cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

This is the PUBLIC form of this artifact. Findings are listed in full, but the details of SECURITY findings — which rule fired, in which file, on which line, and how to fix it — are deliberately withheld, and any secret-scanner results are excluded entirely. Where detail is absent here it was REMOVED FOR PUBLICATION; it is not missing from the analysis. The complete artifact is available from the repository owner.

Score

  • CAI 70 → 71 (+1.3)
  • Rubric changed (rubric-2026.10.5 → rubric-2026.11.4) — scores are not directly comparable.

Lenses

  • Code Health 91 → 85 (-5.8)
  • Architecture 99 → 99 (+0.0)
  • Maturity 63 → 66 (+3.1)
  • Readiness 69 → 68 (-0.9)
  • Security 79 → 82 (+3.3)
  • Performance 80 → 80 (+0.0)

Resolved (22)

  • Duplicated block (10 lines × 2) (fuzz/fuzz_targets/fuzz_redb.rs)
  • Duplicated block (10 lines × 4) (src/table.rs)
  • Duplicated block (10–12 lines × 2) (src/transactions.rs)
  • Duplicated block (11 lines × 2) (src/transactions.rs)
  • Duplicated block (21 lines × 2) (src/tree_store/btree.rs)
  • Duplicated block (26–28 lines × 3) (src/tree_store/btree_mutator.rs)
  • Duplicated block (5 lines × 2) (src/tree_store/page_store/xxh3.rs)
  • Duplicated block (6 lines × 2) (fuzz/fuzz_targets/fuzz_redb.rs)
  • Duplicated block (6 lines × 2) (src/tree_store/page_store/xxh3.rs)
  • Duplicated block (7 lines × 2) (src/multimap_table.rs)
  • Duplicated block (7 lines × 2) (src/table.rs)
  • Duplicated block (8 lines × 2) (src/table.rs)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • Hotspot: fuzz/fuzz_targets/fuzz_redb.rs (fuzz/fuzz_targets/fuzz_redb.rs)
  • Hotspot: src/error.rs (src/error.rs)
  • Members sharing a duplicated core (4 members, 50+ identical tokens) (src/table.rs)
  • MethodTooLong: MultimapTable.insert (src/multimap_table.rs)
  • MethodTooLong: MultimapTable.remove (src/multimap_table.rs)
  • MultimapTable::insert (cognitive 32) (src/multimap_table.rs)
  • …and 2 more

New (91)

  • Duplicated block (10 lines × 2) (fuzz/fuzz_targets/fuzz_corruption.rs)
  • Duplicated block (10 lines × 2) (fuzz/fuzz_targets/fuzz_redb.rs)
  • Duplicated block (10 lines × 2) (src/transactions.rs)
  • Duplicated block (10 lines × 4) (src/table.rs)
  • Duplicated block (11 lines × 2) (src/table.rs)
  • Duplicated block (12 lines × 2) (fuzz/fuzz_targets/fuzz_corruption.rs)
  • Duplicated block (12–14 lines × 2) (fuzz/fuzz_targets/fuzz_corruption.rs)
  • Duplicated block (14 lines × 2) (src/tree_store/btree_mutator.rs)
  • Duplicated block (16 lines × 2) (src/table.rs)
  • Duplicated block (19–20 lines × 2) (src/tree_store/btree_mutator.rs)
  • Duplicated block (21 lines × 2) (src/tree_store/btree.rs)
  • Duplicated block (26–28 lines × 3) (src/tree_store/btree_mutator.rs)
  • Duplicated block (5 lines × 2) (src/tree_store/page_store/xxh3.rs)
  • Duplicated block (6 lines × 2) (crates/redb-bench/src/lib.rs)
  • Duplicated block (6 lines × 2) (fuzz/fuzz_targets/fuzz_redb.rs)
  • Duplicated block (7 lines × 2) (src/multimap_table.rs)
  • Duplicated block (8 lines × 2) (src/multimap_table.rs)
  • Duplicated block (8 lines × 2) (src/table.rs)
  • Duplicated block (8 lines × 2) (src/table.rs)
  • Duplicated block (8 lines × 2) (src/transactions.rs)
  • …and 71 more

Changes since last survey

  • 113 commits — 109 feature/other, 4 fixes

By area

  • crates/redb-python — 43 commits
  • (root) — 41 commits
  • src/tree_store — 15 commits
  • docs/implementation.md — 3 commits
  • src/db.rs — 3 commits
  • crates/redb-derive — 2 commits
  • crates/redb-no-std-test — 2 commits
  • crates/redb-bench-compare — 1 commit
  • src/lib.rs — 1 commit
  • src/table.rs — 1 commit
  • src/types — 1 commit

Notable commits

  • fix: Fix cache_stats() underflowing write_misses during a write
  • fix: Fix the docs build with the chrono_v0_4 feature
  • fix: Fix the no_std rustdoc links, and build the no_std docs in CI
  • fix: Move the fixes that 4.x builds get into a 4.6.0 changelog section
  • change: Add BackendError::Other for backend failures that are not I/O errors
  • change: Add Builder::set_check_integrity_on_open() and a corruption test for repair
  • change: Add Database::close(), which returns the errors that dropping ignores
  • change: Add Database::try_begin_write(), which returns WouldBlock rather than waiting
  • change: Add ReadOnlyDatabase::close(), and empty the page cache on close
  • change: Add a corruption fuzzer for repair and check_integrity()
  • change: Add a read-only constructor for storage backends
  • change: Add document explaining some implementation decisions
  • change: Add some additional implementation decision details
  • change: Admit a reader beside a read-only handle of redb 4.3 or 4.4
  • change: Adopt the file's length when a peer's uncommitted growth left it longer
  • change: Box the TableTypeMismatch and TypeDefinitionChanged details, and report the requested types
  • change: Bump redb-derive version to 0.2.1
  • change: Bump version to 4.5.0
  • change: Bump version to 4.6.0
  • change: Cap integrity verification's walk at the database's page count
  • …and 93 more

Written by cca.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 14 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 5c4704bbe349378800d010de669e152c72298fc3 — the exact code this score is about.
  • Scored under rubric-2026.11.4 — the same rubric and the same method as every other entry in this index.
  • Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.65+preprod-e1a3b69fc8ee.