WAL (write-ahead log)
A database’s log of every change, written before the data files, which makes crash recovery, replication and point-in-time restore possible.
Postgres writes each change to the WAL first; after a crash it replays the log to reach a consistent state. Replicas follow the same log, a base backup plus archived WAL can restore the database to any moment, and CDC tools read it to stream changes. A replication slot that nobody reads keeps old WAL from being deleted and can fill the disk.
Related terms
- CDC (change data capture): Reading committed changes from a database’s own transaction log and streaming them as events to other systems.
- RPO and RTO: How much data you can afford to lose (RPO) and how long you can be down (RTO) after a disaster.
- Backup (3-2-1 rule): Three copies of data, on two kinds of storage, one of them off-site, plus regular restore tests.
