A write-ahead log stores the before and after images recovery will use.
highlighted = computed this step
The log records every change
Write-ahead logging treats the log as the recovery source of truth. A write record carries a before image and an after image before the page change matters. Note: the table shows the ordered log.
write ahead log
Ordered log table
The compiled log contains 3 records and 1 write record. Note: the before and after images are rendered, not typed here.
records=3,writes=1
a simplified redo/undo recovery over a tiny log; ARIES detail (fuzzy checkpoints, CLRs, media recovery) and real durability/fsync are beyond these traces - no product claims.
Summary
The log is the durable evidence recovery replays after a crash. Note: this is simplified redo and undo; ARIES detail, fuzzy checkpoints, CLRs, media recovery, and real fsync durability are deferred.