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.
Lesson 45 of 117 in From Scratch
The rest of this lesson is part of a plan.
A plan opens every lesson, board, video, lab and paper on chalk. Yearly is $39/year.