Index

Module 05 · From ScratchDatabase

Capstone: Database, Everything

Everything
Everything · Open board

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.

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

Review From Scratch →

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