5 releases

0.1.4 Apr 10, 2024
0.1.3 Mar 4, 2024
0.1.2 Jan 3, 2024
0.1.1 Jan 1, 2024
0.1.0 Nov 30, 2023

#101 in Database implementations

Download history 20/week @ 2023-12-29 2/week @ 2024-01-05 9/week @ 2024-02-16 32/week @ 2024-02-23 173/week @ 2024-03-01 25/week @ 2024-03-08 3/week @ 2024-03-15 9/week @ 2024-03-29 135/week @ 2024-04-05 17/week @ 2024-04-12

161 downloads per month

Apache-2.0

50KB
1.5K SLoC

GhalaDb

docs.rs GitHub Workflow Status (with event) Crates.io

A key value datastore that implements keys and values separation inspired by the WiscKey paper.

GhalaDb implements a SSD-conscious data layout by decoupling the storage of keys from values. An in-memory tree stores the keys along with pointers to the values, while the values are stored in a separate log file. This significantly reduces write amplification during ingestion, while facilitating faster data loading.

Since GhalaDb keeps all its keys and data pointers in memory, it is suitable for applications that have small-sized keys.

use ghaladb::{GhalaDb, GhalaDbResult};

fn main() -> GhalaDbResult<()> {
    let mut db = GhalaDb::new("/tmp/ghaladb", None)?;
    let key = "king".to_owned();
    let val = "queen".to_owned();
    db.put(&key, &val)?;
    assert_eq!(db.get(&key)?.unwrap(), val);
    Ok(())
}

References

Dependencies

~2MB
~43K SLoC