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 19 min to read

Play it as a journeyTutor comes with a plan

The engine in production

WAL & Recovery
WAL & Recovery · Open board

The log that every change is written to before the data. This lesson is about everything a real server builds on that log: the replica that reads it, the archive that keeps it, and the slot that holds it.

Before you start. WAL & Recovery showed the write-ahead log: every change goes into an append-only log before it touches a data page, so a crash can be replayed. The Database That Won't Answer showed how to find the query that is hurting a sick server. This lesson is the other half of an on-call week: the server around the engine, which can hurt you without a single slow query. Replication is told in general in Replication, and restores in The Restore Nobody Tested. Here they are measured on Postgres.

Lesson 17 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: the replica that was not a backup
  • A connection is a process
  • A replica is a copy that runs behind
  • A slot is a promise, and promises take disk
  • A replica is not a backup
  • What to watch
  • The primary, with a low ceiling
  • Connections: one process each, and the wall
  • A replica, and a read that is stale
  • A slot nobody is listening to
  • Restore to the second before the mistake
  • Cleaning up

Terms it explains: connection pooler, streaming replica, replication lag, replication slot, base backup, point-in-time recovery.

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