concept

Write-Ahead Log

also called WAL, Commit Log

Recording every change to a durable sequential log before applying it, so that a crash can be recovered by replaying the log.

durabilitydatabasesreplication

The mechanism underneath durability in essentially every serious database. A change is appended to the log and flushed to disk; only then is it applied to data pages, which can happen lazily. If the process dies between the two, recovery replays the log.

Sequential appends are far faster than random page writes, so the WAL improves throughput as well as safety — the same insight that makes append-only storage and log-structured merge trees fast.

It is also the foundation of replication: shipping the WAL to another node and replaying it there is how streaming replication, read replicas and most change-data-capture pipelines work. Knowing this explains why replication lag is measured in log position, and why a replica that falls too far behind cannot always catch up.