#key-value-store #lsm-tree #key-value #dictionary

neutrondb

NeutronDB is a log-structured merge-tree key-value store for any implemented data type

29 releases (13 stable)

5.0.4 Jan 1, 2023
5.0.3 Dec 9, 2022
4.0.0 Oct 18, 2022
2.3.0 Apr 29, 2022
0.9.19 Oct 8, 2021

#190 in Database interfaces

43 downloads per month

MIT license

27KB
579 lines

NeutronDB

NeutronDB is a log-structured merge-tree key-value store for any implemented data type.

Author

Roy R. O. Okello

Email

Github

Twitter

Usage

Cargo.toml

[dependencies]
neutrondb = "5.0.4"

Module.rs

use neutrondb::Store;

About

Files

Neutron Logs


    +-------------------+
    |  Log Type & Data  |
    |  ...              |
    +-------------------+

Neutron Table


    +-----------+
    |  Version  |
    +-----------+

    +-----------------+
    |  Keys & Values  |
    |  ...            |
    +-----------------+

    +----------------+
    |  Bloom Filter  |
    +----------------+

Neutron Graves


    +--------+
    |  Keys  |
    |  ...   |
    +--------+

API

new: directory -> Store

let mut accounts_store: Store<Hash, Account> = Store::new("./ndb")?;

put: &key, &value

accounts_store.put(&Hash, &Account)?;

get: &key -> value


let account = accounts_store.get(&Hash)?;

delete: &key

accounts_store.delete(&Hash)?;

Future

  • 🚀 batching requests for performance
  • 📥 store.put_many(&[(K,V)])
  • 📤 store.get_many(&[K]) -> Vec<(K,V)>
  • 🦾 store.iter(lambda) -> Vec<_>
  • 🧠 store.fold(accumulator, lambda) -> accumulator
  • 🔍 store.any(lambda) -> V
  • 🐘 store.memory(size)
  • 📸 snapshots

License

MIT

Dependencies

~6MB
~108K SLoC