Skip to content

Build an LSM Tree

Build a Log-Structured Merge tree like LevelDB/RocksDB: memtables, SSTables, leveled compaction, k-way merge, bloom filters, write-ahead logging, crash recovery, and the engine behind Cassandra, RocksDB, ScyllaDB, and modern time-series databases.

advanced23 lessons8 chapters23 graded exercisesPython

No sign-up needed for lesson 1 · certificate on completion · sign up to save progress

What you’ll have built

Chapter by chapter. Every step is a graded exercise.

  • MemTable Foundations
  • Write-Ahead Log & Durability
  • SSTable On-Disk Format
  • Flush & Read Path
  • Bloom Filters for Negative Lookups
  • Compaction Strategies
  • Range Queries & Iterators
  • Tombstones & Deletes
Starts in Python — solve in the language you choose in the editor, same tests either way.

Curriculum

8 chapters, 23 lessons. Each lesson is a short read, one graded exercise, and a quiz.

  1. 1Why LSM Trees? Write-Optimized StorageRead · exercise · quiz
  2. 2The MemTable: A Sorted In-Memory BufferRead · exercise · quiz
  3. 3The Skip List: Probabilistic Sorted IndexRead · exercise · quiz
  4. 4Sequence Numbers & MVCC VersionsRead · exercise · quiz
Loading reference solution…