← Back to Labs

Write-ahead log lifecycle

Open a transaction, dirty pages, commit, checkpoint, crash, and recover. Watch the WAL reach durable storage before the data files do.

MEMORY (volatile)log buffer (0)buffer pool0p00p10p20p30p40p5orange = dirty (LSN above disk)DISK (durable)WAL on disk (0) cp@0data files0p00p10p20p30p40p5
LSN 0idle

Begin a transaction, dirty a page, commit it, then checkpoint or crash. The sequence matters because WAL must reach durable storage before the matching data page does.

Shortcuts: B begin · 1-6 update · C commit · K checkpoint · Q crash · R recover · X reset
Tap the controls to run the WAL lifecycle.
Read the full article →Take the quiz →