Build Your Own Database - From Scratch

The whole build, laid out in the order its own walls forced it.
Boards
- The Map
- The Append-Only File
- The Index
- Pages
- The B-Tree
- Write-Ahead Log
- Transactions (MVCC)
- The Query Layer
- Everything
Code: teaching/code/from-scratch/database/ - one Go module, go run ./NN-stage.
Real files, a real B-tree (verified: 1000 keys, height 6, in-order sorted),
real crash recovery, real MVCC snapshots, a tiny SQL planner.
Before you start. This series builds a small copy of a database - a program that keeps rows of data on disk, finds any one of them in an instant, survives the machine dying mid-write, and lets more than one program read and write at once without corrupting each other’s work. It’s the fourth build in the From Scratch track; if you built the small cache or the small message log earlier in it, you already know the shape - start from the plainest file that could work, and add exactly one new mechanism each time it hits a wall it can’t get past on its own.