3 releases (breaking)

Uses old Rust 2015

0.3.0 Jan 22, 2018
0.2.0 Jan 20, 2018
0.1.0 Jan 17, 2018

#6 in #on-disk

MIT license

75KB
1.5K SLoC

NIHdb

A simple single-threaded KV store, with read/write/range-get operations.

A work in progress. Run "cargo test".

Its license right now is MIT.

Right now this is a very simple LSM-tree storage library. Here's why you shouldn't use it:

  • It has no crash resistance
  • It doesn't use bloom filters
  • It doesn't use compression
  • It has some inefficient implementations
  • The file format won't be backwards compatible

Here's why you should use it:

  • It's simple and correct

lib.rs:

NihDB

use nihdb::Store;
let dir = "./testdir-nihdb/";
Store::create(dir).unwrap();
{
    let mut store: Store = Store::open(dir, 2000000).unwrap();

    store.put("some_key".as_bytes(), "Some Value".as_bytes()).unwrap();
    match store.get("some_key".as_bytes()).unwrap() {
        None => {
            println!("Not found!");
        },
        Some(v) => {
            println!("The value is {}", String::from_utf8(v).unwrap());
        },
    };
}

std::fs::remove_dir_all(dir).unwrap();

Dependencies

~500–730KB
~11K SLoC