{"id":13503938,"url":"https://github.com/cberner/redb","last_synced_at":"2025-05-14T22:02:30.491Z","repository":{"id":38019869,"uuid":"150013328","full_name":"cberner/redb","owner":"cberner","description":"An embedded key-value database in pure Rust","archived":false,"fork":false,"pushed_at":"2025-05-14T20:19:25.000Z","size":2238,"stargazers_count":3676,"open_issues_count":20,"forks_count":168,"subscribers_count":25,"default_branch":"master","last_synced_at":"2025-05-14T21:27:15.899Z","etag":null,"topics":["rust"],"latest_commit_sha":null,"homepage":"https://www.redb.org","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cberner.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-09-23T18:30:14.000Z","updated_at":"2025-05-14T20:19:28.000Z","dependencies_parsed_at":"2023-02-19T01:05:13.906Z","dependency_job_id":"903b98fa-1e34-4007-8a3d-1b49de863d6d","html_url":"https://github.com/cberner/redb","commit_stats":{"total_commits":1170,"total_committers":26,"mean_commits":45.0,"dds":0.3358974358974359,"last_synced_commit":"8ea50623b6c25ecabff746f4d1b3c02718643889"},"previous_names":[],"tags_count":61,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cberner%2Fredb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cberner%2Fredb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cberner%2Fredb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cberner%2Fredb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cberner","download_url":"https://codeload.github.com/cberner/redb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254232525,"owners_count":22036567,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["rust"],"created_at":"2024-07-31T23:00:50.226Z","updated_at":"2025-05-14T22:02:29.739Z","avatar_url":"https://github.com/cberner.png","language":"Rust","funding_links":[],"categories":["Rust","Libraries","rust","Database"],"sub_categories":["Database"],"readme":"# redb\n\n![CI](https://github.com/cberner/redb/actions/workflows/ci.yml/badge.svg)\n[![Crates.io](https://img.shields.io/crates/v/redb.svg)](https://crates.io/crates/redb)\n[![Documentation](https://docs.rs/redb/badge.svg)](https://docs.rs/redb)\n[![License](https://img.shields.io/crates/l/redb)](https://crates.io/crates/redb)\n[![dependency status](https://deps.rs/repo/github/cberner/redb/status.svg)](https://deps.rs/repo/github/cberner/redb)\n\nA simple, portable, high-performance, ACID, embedded key-value store.\n\nredb is written in pure Rust and is loosely inspired by [lmdb](http://www.lmdb.tech/doc/). Data is stored in a collection\nof copy-on-write B-trees. For more details, see the [design doc](docs/design.md)\n\n```rust\nuse redb::{Database, Error, ReadableTable, TableDefinition};\n\nconst TABLE: TableDefinition\u003c\u0026str, u64\u003e = TableDefinition::new(\"my_data\");\n\nfn main() -\u003e Result\u003c(), Error\u003e {\n    let db = Database::create(\"my_db.redb\")?;\n    let write_txn = db.begin_write()?;\n    {\n        let mut table = write_txn.open_table(TABLE)?;\n        table.insert(\"my_key\", \u0026123)?;\n    }\n    write_txn.commit()?;\n\n    let read_txn = db.begin_read()?;\n    let table = read_txn.open_table(TABLE)?;\n    assert_eq!(table.get(\"my_key\")?.unwrap().value(), 123);\n\n    Ok(())\n}\n```\n\n## Status\nredb is undergoing active development, and should be considered beta quality. The file format is stable,\nbut redb has not been widely deployed in production systems (at least to my knowledge).\n\n## Features\n* Zero-copy, thread-safe, `BTreeMap` based API\n* Fully ACID-compliant transactions\n* MVCC support for concurrent readers \u0026 writer, without blocking\n* Crash-safe by default\n* Savepoints and rollbacks\n\n## Development\nTo run all the tests and benchmarks a few extra dependencies are required:\n* `cargo install cargo-deny --locked`\n* `cargo install cargo-fuzz --locked`\n* `apt install libclang-dev`\n\n## Benchmarks\nredb has similar performance to other top embedded key-value stores such as lmdb and rocksdb\n\n|                           | redb       | lmdb       | rocksdb        | sled       | sanakirja   |\n|---------------------------|------------|------------|----------------|------------|-------------|\n| bulk load                 | 2689ms     | 1247ms     | 5330ms         | 5892ms     | **1187ms**  |\n| individual writes         | **226ms**  | 419ms      | 703ms          | 816ms      | 398ms       |\n| batch writes              | 2522ms     | 2070ms     | **1047ms**     | 1867ms     | 2776ms      |\n| len()                     | **0ms**    | **0ms**    | 304ms          | 444ms      | 64ms        |\n| random reads              | 860ms      | **624ms**  | 2432ms         | 1596ms     | 875ms       |\n| random reads              | 866ms      | **624ms**  | 2464ms         | 1588ms     | 842ms       |\n| random range reads        | 2347ms     | **1179ms** | 4436ms         | 4907ms     | 1367ms      |\n| random range reads        | 2322ms     | **1207ms** | 4465ms         | 4732ms     | 1373ms      |\n| random reads (4 threads)  | 337ms      | **158ms**  | 732ms          | 488ms      | 349ms       |\n| random reads (8 threads)  | 185ms      | **81ms**   | 433ms          | 259ms      | 277ms       |\n| random reads (16 threads) | 116ms      | **49ms**   | 238ms          | 165ms      | 1708ms      |\n| random reads (32 threads) | 100ms      | **44ms**   | 203ms          | 142ms      | 4714ms      |\n| removals                  | 1889ms     | **803ms**  | 2038ms         | 2371ms     | 1170ms      |\n| uncompacted size          | 1.00 GiB   | 582.22 MiB | **206.38 MiB** | 457.01 MiB | 4.00 GiB    |\n| compacted size            | 311.23 MiB | 284.46 MiB | **106.26 MiB** | N/A        | N/A         |\n\nSource code for benchmark [here](./benches/lmdb_benchmark.rs). Results collected on a Ryzen 5900X with Samsung 980 PRO NVMe.\n\n## License\n\nLicensed under either of\n\n* [Apache License, Version 2.0](LICENSE-APACHE)\n* [MIT License](LICENSE-MIT)\n\nat your option.\n\n### Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally\nsubmitted for inclusion in the work by you, as defined in the Apache-2.0\nlicense, shall be dual licensed as above, without any additional terms or\nconditions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcberner%2Fredb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcberner%2Fredb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcberner%2Fredb/lists"}