Replication ਡੇਟਾ ਨੂੰ ਇੱਕ primary ਡੇਟਾਬੇਸ ਤੋਂ ਇੱਕ ਜਾਂ ਵਧੇਰੇ replica (standby) ਸਰਵਰਾਂ ਤੱਕ ਕਾਪੀ ਕਰਦੀ ਹੈ — ਉੱਚ ਉਪਲਬਧਤਾ (ਜੇ primary ਫੇਲ ਹੋ ਤਾਂ failover) ਅਤੇ read scaling (read queries ਨੂੰ ਵੰਡਣ ਲਈ)। PostgreSQL ਮੁੱਖ ਤੌਰ 'ਤੇ streaming replication (physical) ਵਰਤਦਾ ਹੈ ਜੋ 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
