Index

Free, with Google

Keep going, free.

A free account opens lessons 2 and 3 of every track, 33 more lessons, and keeps your progress and review cards on every device.

Start free with Google

A chalk plan

Open everything on chalk.

Every lesson, board, video, lab and paper, and the full review decks. Yearly is $39/year.

See plansStart free instead

Module 01 · Database Internals · One Database, to the Bolt · about 18 min to read

Play it as a journeyTutor comes with a plan

WAL & Recovery

WAL & Recovery
WAL & Recovery · Open board

The page travelling from memory to disk, with the log that has to beat it there. Follows The Buffer Pool;

Before you start. The last lesson showed that the database keeps its own copies of pages in RAM and changes them there, not on disk, because touching RAM is roughly a thousand times faster than touching disk. That is also the danger this lesson exists to fix: a change that has only ever existed in RAM disappears completely the moment the machine loses power, before it ever reaches a disk file.

Lesson 5 of 26 in Database Internals

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.

See plansAlready a member? Sign in

Or start free: a free account opens lessons 2 and 3 of every track.

In this lesson

  • 31 January 2017: a wiped primary, and no ledger to read back
  • The rule: write the plan before you touch the shelf
  • COMMIT, and the one wait it can’t skip
  • The crash, and the ledger that rebuilds it

Terms it explains: write-ahead log, fsync, checkpoint, redo, long, fast.

Lab

You checkpoint three times as often for a faster restart. Why does the log get bigger?

Drag How long the log may run between checkpoints to its shortest, press Add next write repeatedly, and watch If the power died now.

Open The write-ahead log

Related papers

Review Database Internals