Crates.io | rsdb |
lib.rs | rsdb |
version | 0.12.1 |
source | src |
created_at | 2016-11-02 11:31:48.285911 |
updated_at | 2017-09-05 19:13:41.27537 |
description | a flash-sympathetic persistent lock-free B+ tree, pagecache, and log |
homepage | https://github.com/spacejam/rsdb |
repository | https://github.com/spacejam/rsdb |
max_upload_size | |
id | 7110 |
size | 290,950 |
A modern lock-free atomic embedded database designed to beat LSM trees for reads and traditional B+ trees for writes.
It uses a modular design which can also be used to implement your own high
performance persistent systems, using the included LockFreeLog
and PageCache
.
Eventually, a versioned DB will be built on top of the Tree
which provides
multi-key transactions and snapshots.
The Tree
has a C API, so you can use this from any mainstream language.
extern crate rsdb;
let tree = rsdb::Config::default()
.path(Some(path))
.tree();
// set and get
tree.set(k, v1);
assert_eq!(tree.get(&k), Some(v1));
// compare and swap
tree.cas(k, Some(v1), Some(v2));
// scans
let mut iter = tree.scan(b"a non-present key < k!");
assert_eq!(iter.next(), Some((k, v2)));
assert_eq!(iter.next(), None);
// deletion
tree.del(&k);
fallocate
!Lock-free trees on a lock-free pagecache on a lock-free log. The pagecache scatters partial page fragments across the log, rather than rewriting entire pages at a time as B+ trees for spinning disks historically have. On page reads, we concurrently scatter-gather reads across the log to materialize the page from its fragments.
The system is largely inspired by the Deuteronomy architecture, and aims to implement the best features from RocksDB as well.