Why architecture matters here
WAL fails on lost fsync (subtle durability loss), storage slow (fsync latency dominates commit), and missing archive (no PITR). Architecture matters because durability + latency are joint.
The architecture: every piece explained
The top strip is the mechanism. Transaction modifies pages. WAL append before dirty write. LSN monotonic. fsync durability boundary.
The middle row is amortization + recovery. Group commit batches fsyncs. Checkpoint advances the recovery start. Replay on restart. Archive + PITR.
The lower rows are ops. Storage class — SSD + battery-backed. Metrics fsync + WAL rate. Ops — retention + backup + monitoring.
End-to-end flow
End-to-end: transaction modifies rows. WAL appended. Group commit batches fsync every N ms. Checkpoint flushes dirty pages every 5 min. Crash: replay from last checkpoint LSN. Archive ships WAL to S3 for PITR.