Crates.io | index |
lib.rs | index |
version | 0.15.4 |
source | src |
created_at | 2018-02-12 08:50:10.441415 |
updated_at | 2018-02-12 08:50:10.441415 |
description | a flash-sympathetic persistent lock-free B+ tree |
homepage | https://github.com/spacejam/sled |
repository | https://github.com/spacejam/sled |
max_upload_size | |
id | 50799 |
size | 39,491 |
A pre-alpha modern embedded database.
extern crate sled;
use sled::{ConfigBuilder, Tree};
let config = ConfigBuilder::new()
.path(path)
.build();
let tree = Tree::start(config).unwrap();
// set and get
tree.set(k, v1);
assert_eq!(tree.get(&k), Ok(Some(v1)));
// compare and swap
tree.cas(k, Some(v1), Some(v2));
// scan forward
let mut iter = tree.scan(k);
assert_eq!(iter.next(), Some(Ok((k, v2))));
assert_eq!(iter.next(), None);
// deletion
tree.del(&k);
Db
versioned-key interface1.0.0
release! after that, we will always support
forward migrations.want to help advance the state of the art in open source embedded databases? check out CONTRIBUTING.md!
lock-free tree 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.