The idea to keep with you
If latency budgets leave no room for synchronous retries, WAL bloat comes from pinned LSN horizons (dead replication slots or long transactions), while periodic p99 stalls come from unpaced checkpoints saturating disk IOPS.
TL;DR30-second simplified summary▾
WAL bloat beyond max_wal_size indicates a pinned LSN horizon—typically an inactive replication slot's restart_lsn or a failing archive_command—while 15-minute p99 stalls stem from WAL-triggered checkpoints and FPW bursts saturating shared IOPS. Remediate by setting max_slot_wal_keep_size, raising max_wal_size with checkpoint_completion_target=0.9, enabling zstd WAL compression, and isolating pg_wal.
Before you begin · Building blocksAlready know these? Jump to Stage 01 ↓
Write-Ahead Logging (WAL) & ARIES Recovery
Write-Ahead Logging turns random dirty-page disk writes into sequential log appends, while ARIES (Analysis, Redo, Undo) reconstructs exact database state after a crash.
Backpressure & Flow Control
Backpressure lets a slow consumer signal an upstream producer to slow down or pause, preventing unbounded memory growth and out-of-memory crashes.
Database Connection Pool Tuning
Sizing and lifecycle-tuning database connection pools so applications maximize throughput without overwhelming the database with context switches, lock contention, or stale TCP sockets.
Database Isolation Levels & Transaction Anomalies
Database isolation levels control what concurrent transaction anomalies—dirty reads, non-repeatable reads, phantom reads, and write skew—are permitted in exchange for lower locking or coordination overhead.
Full walkthrough · 7 stages
01
L4 · FUNDAMENTALS
.
02
L4 · FUNDAMENTALS
.
03
L5 · APPLIED DESIGN
.
04
L5 · APPLIED DESIGN
.
05
L6 · SCALE & TRADE-OFFS
.
06
L6 · SCALE & TRADE-OFFS
.
07
L7 · STAFF / PRINCIPAL
.
Practice · Explain the consequences
Practice: Make the trade-off yourself.
Question 1 of 3
Score: 0/3Which PostgreSQL setting prevents a disconnected replica from filling the primary server's pg_wal disk?
Recommended Learning Flow