Pages

From the small database this series builds, one of the six programs the From Scratch build makes from real ones. Follows Database 02: The Index, which turned a lookup into a single byte offset in the file.
Before you start. This series builds a small database of our own: a program that stores rows of data on disk and can find any one of them again on demand. So far it does two things. It writes every new row onto the end of a file, one after another, so nothing already there gets overwritten. And it looks up a row instantly, because a table kept in memory turns a key straight into the exact byte where that row starts, instead of reading the whole file to find it.