redb is a simple,Portable, high-performance, ACID, embedded key-value storage.

redb is written in pure Rust and is supported by lmdb some stored inan mmap’ed,copy-on-write B-trees in the collection.For details, seedesign document.

use redb::{Database, Error, ReadableTable, TableDefinition};

const TABLE: TableDefinition<str, u64> = TableDefinition::new("my_data");

fn main() -> Result<(), Error> {
    let db = unsafe { Database::create("my_db.redb")? };
    let write_txn = db.begin_write()?;
        let mut table = write_txn.open_table(TABLE)?;
        table.insert("my_key", &123)?;

    let read_txn = db.begin_read()?;
    let table = read_txn.open_table(TABLE)?;
    assert_eq!(table.get("my_key")?.unwrap(), 123);


redb is under active development.


  • Zero-copy, thread-safe, based onBTreeMapAPI
  • Fully ACID compliant transactions
  • MVCC supports concurrent readers and writers, non-blocking
  • default Crash-safe
  • Savepoints and rollbacks


#redb #homepage #documentation #downloads #Embedded #keyvalue #database #pure #Rust #News Fast Delivery

Leave a Comment

Your email address will not be published. Required fields are marked *