data-infra

Write-Ahead Log (WAL)

A write-ahead log (WAL) is an append-only file where a database records every change before applying it to the actual data files. The rule is in the name: the change is written to the log first, then to the tables. If the server crashes mid-write, the database replays the log on restart to recover a consistent state — nothing committed is ever lost. This one mechanism underpins durability (the D in ACID), and it quietly powers much more. Point-in-time recovery replays the WAL up to a chosen moment. Streaming replication ships the WAL to replicas so they stay in sync. Change-data-capture tools read the WAL to emit an event for every row that changes. For SaaS builders, the practical takeaways are: WAL is why a crashed Postgres comes back intact, and why heavy write bursts can bloat disk if the log isn't archived or drained. Monitor WAL growth, and lean on it — not triggers — when you need a reliable change feed.

Related terms

More Data & Infra terms