Caffeinated Coder
Book an appointment
Lesson 17 · Inside a database

Write-ahead logging and recovery

A database changes pages in memory and writes them back later, so how does a commit survive a power cut? Follow two transactions through PostgreSQL's write-ahead log (WAL): every change is logged before its page may reach disk, COMMIT waits only for the log, and after a crash, replay from the last checkpoint brings back every committed change while the unfinished one stays invisible.

14 min10 steps5 questionsAdvanced
Fig 17 · Interactive
Loading figure…
or ← →

Quiz Unlocks after the last step.