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.

Advertisement

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.

WAL — log-first + LSN + group commit + fsync + replaydurability without random writesTransactionmodify pagesWAL appendbefore dirty page writeLSNmonotonic orderingfsyncdurability pointGroup commitbatch fsyncsCheckpointflush dirty + advanceReplay on restartfrom checkpoint LSNArchive + PITRlog shippingStorage classSSD + battery-backedMetricsfsync + WAL rateOps — WAL retention + backup + monitoringamortizecheckpointrecoverarchivestoragewatchwatchoperateoperate
WAL pipeline: append + fsync + checkpoint + replay.
Advertisement

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.