HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
spacejam
sled
Rust2018–2026
spacejam / sled

sled

the champagne of beta embedded databases

24Distinct people
25Mentions
0Explicit recommenders
9.1KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

the champagne of beta embedded databases

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

Mentioned in the same Hacker News threads. That is not proof they are substitutes.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 1:49:46 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year25 dated mentions

Observed mentions: 2018-03-22 08:57:07 UTC to 2026-05-29 04:09:50 UTC.

0369122018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 4 mentions; 3 submissions, 1 comments20182019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 11 mentions; 1 submissions, 10 comments2021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments20222023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 3 mentions; 1 submissions, 2 comments2025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2026-01-01 00:00:00 UTC to 2027-01-01 00:00:00 UTC (exclusive): 1 mentions; 1 submissions, 0 comments. Incomplete calendar period.2026*

* An incomplete calendar period is marked with an outlined bar. Its count is not directly comparable with a full period.

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC431
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC101
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC11110
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC202
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC101
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC000
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC312
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC202
2026 (partial)2026-01-01 00:00:00 UTC2027-01-01 00:00:00 UTC110

From the project README

An excerpt from the repository, fetched Nov 13, 2026.

Read the project’s introduction
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 contains \space a \space large \space in-progress \space rewrite }$$ If you would like to work with structured data without paying expensive deserialization costs, check out the structured example! features API similar to a threadsafe BTreeMap<[u8], [u8]> serializable (ACID) transactions for atomically reading and writing to multiple keys in multiple keyspaces. fully atomic single-key operations, including compare and swap zero-copy reads write batches subscribe to changes on key prefixes multiple keyspaces merge operators forward and reverse iterators over ranges of items a crash-safe monotonic ID generator capable of generating 75-125 million unique ID's per second zstd compression (use the compression build feature, disabled by default) cpu-scalable lock-free implementation flash-optimized log-structured storage uses modern b-tree techniques such as prefix encoding and suffix truncation for reducing the storage costs of long keys with shared prefixes. If keys are the same length and sequential then the system can avoid storing 99%+ of the key data in most cases, essentially acting like a learned index expectations, gotchas, advice Maybe one of the first things that seems weird is the IVec type. This is an inlinable Arced slice that makes some things more efficient. Durability: sled automatically fsyncs every 500ms by default, which can be configured with the flush_every_ms configurable, or you may call flush / flush_async manually after operations. Transactions are optimistic - do not interact with external state or perform IO from within a transaction closure unless it is idempotent. Internal tree node optimizations: sled performs prefix encoding on long keys with similar prefixes that are grouped together in a range, as well as suffix truncation to further reduce the indexing costs of long keys. Nodes will skip potentially expensive length and offset pointers if keys or values are all the same length (tracked separately, don't worry about making keys the same length as values), so it may improve space usage slightly if you use fixed-length keys or values. This also makes it easier to use structured access as well. sled does not support multiple open instances for the time being. Please keep sled open for the duration of your process's lifespan. It's totally safe and often quite convenient to use a global lazy_static sled instance, modulo the normal global variable trade-offs. Every operation is threadsafe, and most are implemented under the hood with lock-free algorithms that avoid blocking in hot paths. performance LSM tree-like write performance with traditional B+ tree-like read performance over a billion operations in under a minute at 95% read 5% writes on 16 cores on a small dataset measure your own workloads rather than relying on some marketing for contrived workloads a note on lexicographic ordering and endianness If you want to store numerical keys in a way that will play nicely with sled's iterators and ordered operations, please remember to store your numerical items in big-endian form. Little endian (the default of many things) will often appear to be doing the right thing until you start working with more than 256 items (more than 1 byte), causing lexicographic ordering of the serialized bytes to diverge from the lexicographic ordering of their deserialized numerical form. Rust integral types have built-in to_be_bytes and from_be_bytes methods. bincode can be configured to store integral types in big-endian form. interaction with async If your dataset resides entirely in cache (achievable at startup by setting the cache to a large enough value and performing a full iteration) then all reads and writes are non-blocking and async-friendly, without needing to use Futures or an async runtime. To asynchronously suspend your async task on the durability of writes, we support the flush_async method, which returns a Future that your async tasks can await the completion of if they require high durability guarantees and you are willing to pay the latency costs of fsync. Note that sled automatically tries to sync all data to disk several times per second in the background without blocking user threads. We support async subscription to events that happen on key prefixes, because the Subscriber struct implements Future<Output=Option<Event>>: let sled = sled::open("my_db").unwrap(); let mut sub = sled.watch_prefix(""); sled.insert(b"a", b"a").unwrap(); extreme::run(async move { while let Some(event) = (&mut sub).await { println!("got event {:?}", event); } }); minimum supported Rust version (MSRV) We support Rust 1.62 and up. architecture 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. check out the architectural outlook for a more detailed overview of where we're at and where we see
Read the full README on GitHub

What Hacker News says

25 sources
Maybe consider sled? https://github.com/spacejam/sled It's been abandoned for some years, the author was working on a new engine for it and in the last 5 days they started working again on sled proper. However, it's pretty good the way it is (the 0.34.7 release from 2021 https://crates.io/crates/sled), despite the beta warnings More info here https://dbdb.io/db/sled (Note, non affiliated to the author, just liked the project)
In ToyDB rewritten: a distributed SQL database in Rust, for education
Sure! I mentioned a few orthogonal concepts that go well together, and each of the following examples has a different combination that they employ: - the company that developed Madsim (RisingWave) [0] [1] is tries hardest to eliminate non-determinism with the broadest scope (stubbing out syscalls, etc.) - sled [2] itself has an interesting combo of deterministic tests combined with quickcheck+failpoints test case auto-discovery - Dropbox [3] uses a similar approach but they talk about it a bit more abstractly. Sans-IO is more documented in Python [4], but str0m [5] and quinn-proto [6] are the best examples in Rust I’m aware of. Note that sans-IO is orthogonal to deterministic test frameworks, but it composes well with them. With the disclaimer that anything I comment on this site is my opinion alone, and does not reflect the company I wor
Read the rest
k at —— I do work at a rust shop that has utilized these techniques on some projects. TigerBeetle is an amazing example and I’ve looked at it before! They are really the best example of this approach outside of FoundationDB I think. [0]: https://risingwave.com/blog/deterministic-simulation-a-new-e... [1]: https://risingwave.com/blog/applying-deterministic-simulatio... [2]: https://dropbox.tech/infrastructure/-testing-our-new-sync-en... [3]: https://github.com/spacejam/sled [4]: https://fractalideas.com/blog/sans-io-when-rubber-meets-road... [5]: https://github.com/algesten/str0m [6]: https://docs.rs/quinn-proto/0.10.6/quinn_proto/struct.Connec...
In Is something bugging you?
I just found these today which are LSM-based storage engines which supposedly support both transactions. Sled can operate on a single file, I'm not sure about wiredtiger. I've never used either of these before though, so please perform your own due diligence: - https://github.com/spacejam/sled - http://source.wiredtiger.com/11.0.0/overview.html To add transaction support, you probably need a good understanding of how the memtable works in Log Structured Merge trees: https://creativcoder.dev/what-is-lsm-tree as well as how to implement something like https://en.wikipedia.org/wiki/Optimistic_concurrency_control You might also be interested in the design of the Nova database: https://www.usenix.org/conference/fast16/technical-sessions/... There are probably newer system designs out there, this just happened to be linked from the creativcoder
Read the rest
.dev article above.
In Ask HN: Serverless” key value store with transactions?
The author of sled[1], an embedded database in Rust which has a number of promising features, has also written parts of rio[2], an underlying pure Rust io_uring library, which is intended to become the core write path for sled. rio has support for files but also has a demo for TCP (on Linux 5.5 and later) and O_DIRECT. I tested rio recently as I had a Brilliant but Bad Idea™ involving file access and was pleasantly surprised by the API, as I have been with sled's. I'm excited for the experimentation in the Rust ecosystem and for such low level crates to handle the complex io_uring tasks (relatively) safely! [1]: https://github.com/spacejam/sled [2]: https://github.com/spacejam/rio
In Tokio 1.0 – async runtime for Rust
> Applications of Java and Rust do not overlap. Both are general purpose languages, so of course they overlap. > Good luck rewritting all the big data tools from Java (Elasticsearch, Spark, Kafka, Hadoop, Neo4j, Deeplearning4j, Cassandra, Solr, Arrow, OrientDB) Cassandra (https://scylladb.com) and Kafka (https://vectorized.io) have already been rewritten once in C++, with massive latency and throughput improvements. No reason why they couldn't get their superior Rust clones in the observable future. Materialize (https://materialize.com), Noria (https://github.com/mit-pdos/noria), and Sled (https://github.com/spacejam/sled) are just some of the Rust database projects that are aiming at unseating the de facto standard implementations in the space. InfluxDB (https://www.influxdata.com) is now doing major Rust development as well. The future
Read the rest
is almost here. It's just not evenly distributed yet.
In Why AWS loves Rust, and how we’d like to help

Showing the 15 most recent of 25 sources. Enable JavaScript to search and browse every indexed mention.

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.