Replication hunakili data kutoka database ya primary hadi server moja au zaidi za replica (standby) — kwa high availability (failover kama primary ikishindwa) na read scaling (kusambaza read queries). PostgreSQL hutumia hasa streaming replication (physical) kulingana na 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
