Table of Contents

WAL & checkpoint

In one line: the write-ahead log makes a commit durable; the checkpoint consolidates it into the data file and recycles WAL space — it adds no durability.

A commit is written to the append-only WAL, and becomes durable the instant its record is fsync'dwhen that happens is set by the durability mode. The checkpoint runs in the background, draining dirty pages into the data file and marking consumed WAL segments recyclable. Crucially, the checkpoint doesn't add durability — a change is equally safe whether recovered by WAL replay or already on the data pages; the checkpoint only moves where the durable copy lives.

WAL and checkpoint are mandatory (a whole-database no-WAL mode was removed); to run without disk I/O you inject an in-memory WAL backend rather than disabling it. On crash, recovery replays the WAL and reconstructs every transaction whose commit record reached disk, atomically.

How it relates

In the API

  • WalWriterOptions — enables and tunes the WAL (options.Wal = new WalWriterOptions()).

Learn & use