Index

Module 06 · From ScratchLSM Tree

Build Your Own LSM Tree

Storage Engines
Storage Engines · Open board

The Data Systems board on the two honest ways to put bytes on a disk and find them again. The B-tree is one of them. This build is the other. Head of the LSM series, after the Database build (Build Your Own Database - From Scratch).

Before you start. This series builds a small copy of a storage engine: the part of a database that stores keys and values on disk and finds them again. The Database build made one kind, a B-tree that edits pages in place. This one makes the other kind, which never edits anything: it only appends, sorts in batches, and merges in the background. You need Storage Engines for the two-engine picture and Write-Ahead Log for why a write must reach a log before anything else. Storage Extras: richer indexes, warehouse schemas, column tricks covers Bloom filters and compaction in prose; this build writes them. The lab lsm-vs-btree puts a dial on the trade between the two engines.

Continue reading with a plan

The first three lessons of every track are free. This lesson is included with a plan, which unlocks every lesson, board, video, lab and paper for one price.

View plans →Already a member? Sign in

Lab

Write-heavy wants an LSM, read-heavy wants a B-tree. Where exactly is the flip?

Drag Share of the workload that is reads across its whole range and watch the winner under Who finishes first flip.

Open LSM vs B-tree →

Related paper

Review From Scratch →

Saved in this browser, and to your account when you sign in.