write-ahead-log · shipping · also WAL

Write-ahead log

A write-ahead log is a recovery log whose relevant records must become durable before the corresponding changes are persisted in database data files.

Related Observatory article: Read on hesela.com

Write-ahead logging names the ordering protocol; the write-ahead log is its record stream. PostgreSQL can replay logged changes after a crash, so committing a transaction need not flush every modified data page. A record in a memory buffer is not yet a durable record. Preserving older WAL for point-in-time recovery is a separate archive-retention task. [4] SQLite's alternative rollback journal stores before-images; its WAL-mode atomicity applies per database, not to a multi-file ATTACH transaction as a set. [5] Replication-slot retention serves a consumer's catch-up needs; it does not replace a separately preserved recovery archive. [6]

Relations

related
Database checkpoint, Full-page write, fsync, Persistence ordering, Crash consistency, Log sequence number, Point-in-time recovery, WAL archiving, Rollback journal, SQLite super-journal, Checkpoint starvation, SQLite WAL end mark, RocksDB column family, RocksDB atomic flush, Group commit, Asynchronous commit, Replication slot, Logical decoding, Doublewrite buffer, LLAMA, Frangipani, LevelDB

Advantages

  • Allows changed data pages to be written later while preserving logged recovery information. [1]

Limitations

  • Recovery still depends on storage honoring synchronization requests. [2]

Citations

  1. PostgreSQL 18: Write-Ahead Logging (accessed 2026-10-11)
  2. PostgreSQL 18: Reliability (accessed 2026-10-11)
  3. PostgreSQL 18: Continuous Archiving and Point-in-Time Recovery (accessed 2026-10-14)
  4. SQLite: ATTACH DATABASE, atomicity across files (accessed 2026-10-14)
  5. PostgreSQL 18: replication slots and WAL retention (accessed 2026-10-16)

Further reading

  1. WAL, checkpoints and torn pages: three different recovery guarantees (accessed 2026-10-11)

JSON: /data/terms/write-ahead-log.json

Published by Hesela team · Updated

Report a correction · Editorial standards · Reuse guidance

Cite this page
Hesela team. Write-ahead log. Hesela. 2026-11-30. https://hesela.dev/terms/write-ahead-log/