WeSearch

Sled – An Embedded Database in Rust

·5 min read · 0 reactions · 0 comments · 11 views
#database#rust#technology
Sled – An Embedded Database in Rust
⚡ TL;DR · AI summary

Sled is an embedded database implemented in Rust that offers a variety of features for efficient data management. It supports atomic operations, transactions, and provides a threadsafe API similar to BTreeMap. The database is designed for high performance with optimizations for storage and retrieval, making it suitable for applications requiring structured data handling.

Key facts
Original article
GitHub
Read full at GitHub →
Opening excerpt (first ~120 words) tap to expand

key value documentation chat about databases with us sled - it's all downhill from here!!! An embedded database. let tree = sled::open("/tmp/welcome-to-sled")?; // insert and get, similar to std's BTreeMap let old_value = tree.insert("key", "value")?; assert_eq!( tree.get(&"key")?, Some(sled::IVec::from("value")), ); // range queries for kv_result in tree.range("key_1".."key_9") {} // deletion let old_value = tree.remove(&"key")?; // atomic compare and swap tree.compare_and_swap( "key", Some("current_value"), Some("new_value"), )?; // block until all operations are stable on disk // (flush_async also available to get a Future) tree.flush()?; $${\color{red}This \space README \space is \space out \space of \space sync \space with \space the \space main \space branch \space which \space…

Excerpt limited to ~120 words for fair-use compliance. The full article is at GitHub.

Anonymous · no account needed
Share 𝕏 Facebook Reddit LinkedIn Threads WhatsApp Bluesky Mastodon Email

Discussion

0 comments

More from GitHub