Replication copia i dati da un database primary a uno o più server replica (standby) — per alta disponibilità (failover se il primary fallisce) e read scaling (distribuire le query di lettura). PostgreSQL utilizza principalmente streaming replication (fisica) basata sul write-ahead log (WAL).
Streaming (physical) replication
Primary ──(streams WAL: the write-ahead log of changes)──▶ Replica(s)
✓ The primary handles all WRITES
✓ Replicas continuously apply the primary's WAL → stay in sync (near-real-time)
✓ Replicas can serve READ queries ("hot standby") → scale reads
