The finale of the small database this series built, tying together every earlier piece with the project lesson Build Your Own Database, From Scratch.
Before you start. This series has been building a small database of our own: a program that stores rows on disk, finds one fast, and survives a crash without losing or corrupting a row. By now our small database can do all of this:
Write every change to the end of a file, and never edit a line already there.
Jump straight to a key instead of reading the whole file, using a small lookup kept apart from it.
Pack rows into fixed-size chunks called pages, so one trip to the disk always moves a whole chunk at once.
Walk down a small number of signposts to find any key among hundreds of thousands, instead of checking each one.
Write down a change before touching the real data, so a crash mid-write can be undone or finished cleanly.
Keep an old and a new copy of a changed row side by side, so two readers can see two different, both-correct answers.
Read a question typed in plain words, like a front desk reading a request slip, and work out which rooms to send it through.
Lesson 53 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.