Replication एक primary database से data को एक या अधिक replica (standby) servers पर copy करता है — high availability (primary के विफल होने पर failover) और read scaling (read queries वितरित करना) के लिए। PostgreSQL मुख्य रूप से write-ahead log (WAL) पर आधारित streaming replication (physical) का उपयोग करता है।
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
