WALs
WALs, short for write-ahead logs, are a technique used to ensure durability and consistency of data modifications in computer systems, most notably in databases and journaling file systems. The core idea is to record every intended change to a log before applying it to the primary data store, so that after a crash the system can recover by reprocessing the log.
In a typical WAL implementation, each log record includes a log sequence number, a transaction identifier, the
Recovery uses the WAL to reconstruct a consistent database state after a failure. By replaying the log,
Examples and contexts: PostgreSQL relies on a robust WAL to enable crash recovery, PITR, and streaming replication.
Considerations for managing WALs include the I/O overhead of writing logs, the need for log retention and