finds.dev← search

// the find

skyzh/mini-lsm

★ 4,050 · Rust · Apache-2.0 · updated Apr 2026

A course of building an LSM-Tree storage engine (database) in a week.

A three-week guided course for building a production-grade LSM-tree storage engine in Rust, walking you from raw memtable through SST blocks, compaction strategies, WAL, and full MVCC with serializable snapshot isolation. It's aimed at developers who want to understand how RocksDB-style engines actually work, not just use one. The author (Chi Zhang / skyzh) previously built TiKV components, so the material is grounded in real production concerns.

The progression from Week 1 through Week 3 is genuinely well-sequenced — you implement bloom filters and prefix key encoding before touching compaction, which is the right order. All three major RocksDB compaction strategies (simple leveled, tiered/universal, leveled) are covered with a compaction simulator binary you can actually run to see the tradeoffs. The MVCC chapter goes all the way to serializable snapshot isolation with OCC conflict detection, not just 'we added timestamps.' Having both reference solutions and starter stubs in the same repo with a sync tool is a good design — you can peek at the answer without it being trivially copy-pasteable.

Week 4 ('The Extra Week') has been 'in progress' since the repo launched and the README itself says it's 'unlikely to be available in 2025' — it's effectively abandoned, which means distributed scenarios, remote compaction, and tiered object-storage layouts (the interesting modern stuff) are left as an exercise. The course copyright structure is awkward: code is Apache 2.0 but the markdown book files are all-rights-reserved, which means you can legally fork and modify the engine but not the written explanations that give it value. There's no async I/O anywhere — everything is sync, which is fine for learning but means the patterns won't transfer directly to production Rust where Tokio is standard. The solution checkpoint repo updates infrequently, so if the main repo's API drifts (which the README acknowledges happens), the checkpoints can be misleading.

View on GitHub → Homepage ↗

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →