SMILING TREE LOGO


sled
home
documentation

blog
introduction to sled
motivating experiences

sled

documentation chat Open Collective backers

A modern embedded database. Written in Rust, usable on servers and phones from any C-compatible language.

use sled::Db;

let db = Db::open(path)?;   // as in fs::open
db.insert(k, v)?;           // as in BTreeMap::insert
db.get(&k)?;                // as in BTreeMap::get
for kv in db.range(k..) {}  // as in BTreeMap::range
db.remove(&k)?;             // as in BTreeMap::remove
drop(db);                   // fsync and close file

Embedded databases are useful in several cases:

sled features

references