mini-lsm
learn database internals by building a storage engine in Rust
What is mini-lsm?
learn database internals by building a storage engine in Rust
Overview of mini-lsm
What it is
Mini-LSM is a hands-on course in database internals for systems and backend engineers. It guides learners to build an LSM-tree storage engine from memtables and SSTs through compaction, crash recovery, MVCC, and transactions. The course is structured into three weeks, with Week 1 producing a working storage engine and Weeks 2 and 3 adding production-inspired features. It requires basic Rust knowledge but no prior familiarity with LSM trees, compaction, MVCC, or transaction isolation.
Key features
- Ordered in-memory write buffer and immutable SST files - Point lookups and range scans over merged memory and disk state - Multiple compaction strategies and background maintenance - A manifest and write-ahead log for crash recovery - Snapshots, MVCC garbage collection, optimistic concurrency control, and serializable validation for tracked keys
Use cases
Mini-LSM is designed for systems and backend engineers who want to learn database internals by implementing a storage engine. It is suitable for those who have used databases such as PostgreSQL, MySQL, Redis, or RocksDB and wish to understand the storage layer below their APIs. The course focuses on the storage layer and does not cover SQL parsing, query optimization, replication, or distributed consensus.
Getting started
Students should modify code in the mini-lsm-starter directory. The following commands are used to set up and run the project: cargo x install-tools cargo x copy-test --week 1 --day 1 cargo x scheck cargo run --bin mini-lsm-cli cargo run --bin compaction-simulator The course offers two learning paths: a guided three-week course and a coding-agent track spanning three planned days.
License and pricing
Mini-LSM is open source under the Apache-2.0 license. It is free to use.
Based on the project's public README and repository metadata.