Replikering kopierar data från en primär databas till en eller flera replika (standby) servrar — för hög tillgänglighet (failover om den primära databasen misslyckas) och lässkaling (distribuera läsfrågor). PostgreSQL använder främst streaming replication (fysisk) baserad på write-ahead log (WAL).
Streaming (fysisk) replikering
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
