Arama Yap Mesaj Submit
Request a Callback
+90
X
X

Select Your Currency

Turkish Lira $ US Dollar Euro
X
X

Select Your Currency

Turkish Lira $ US Dollar Euro

Contact Us

Location Halkali merkez neighborhood fatih st ozgur apt no 46 , Kucukcekmece , Istanbul , 34303 , TR
POSTGRESQL · HA · STREAMING REPLICATION · WAL

PostgreSQL HA Server: A Replica Is Not the Same as a Failover Design

A PostgreSQL standby alone is not a complete HA design. Replication mode, WAL retention, failover triggers, client routing, split-brain prevention and backup/recovery must be planned together. Synchronous replication can reduce data-loss risk while increasing commit latency.

protocol / 2026
01Primary / Standby
02WAL
03Synchronous
04RPO / RTO
Updated · 18.08.2026
01
On this page

What does PostgreSQL synchronous replication provide?

PostgreSQL documentation states synchronous replication can require one or more standbys to confirm changes before commit completes. This improves durability but can add network/standby latency. Asynchronous replication can be faster but may lose the latest WAL changes during failover.

On this pagePostgreSQL HA Server: A Replica Is Not the Same as a Failover Design
01
HA flow

Primary, standby and client-routing layers

Applications can connect through a virtual endpoint, HAProxy or failover-aware service rather than a fixed primary IP. The standby follows the WAL stream and can be promoted when required.

01Application
02DB Endpoint
03Primary
04WAL Stream
05Standby
02
Replication choice

What trade-off exists between synchronous and asynchronous replication?

Balance latency tolerance against data-loss tolerance.

AsynchronousLower commit latencyRPO may be > 0Common
SynchronousHigher durabilityStandby latency mattersCritical data
Read replicaRead scalingWrites on primaryReporting
03
Failover readiness

A replica does not automatically mean failover is ready

Promotion, DNS/LB routing, fencing, client reconnect and replication-slot state should be tested.

Promotion procedure
Fence old primary
Client reconnect
Replication-slot checks
DNS/LB switch
Failback plan
04
PostgreSQL checks

Verify replication and recovery state with SQL

Run commands with an appropriately privileged PostgreSQL user.

Command 1
psql -c "SELECT pg_is_in_recovery();"
Command 2
psql -c "SELECT application_name,state,sync_state,write_lag,flush_lag,replay_lag FROM pg_stat_replication;"
Command 3
psql -c "SELECT pg_current_wal_lsn();"
Command 4
pg_isready
05
HA + backup

Replication does not replace backups

A bad DELETE, schema mistake or corruption can replicate too. Independent recovery such as base backups plus WAL archive is needed for point-in-time recovery.

Base backup
WAL archive
Offsite copy
Retention
PITR test
Document RPO/RTO
Official documentation

Official sources

PostgreSQLHigh Availabilitywww.postgresql.orgPostgreSQLWarm Standbywww.postgresql.orgPostgreSQLFailoverwww.postgresql.orgPostgreSQLReplication Configwww.postgresql.orgEKA SunucuVPSwww.ekasunucu.com
FAQ

Frequently asked questions

How many nodes for PostgreSQL HA?

There is no single universal number. Primary plus standby can be two data nodes; automated quorum/failover tooling may require additional nodes or witnesses.

Does synchronous replication guarantee zero data loss?

It improves commit durability when configured correctly, but full-system failure scenarios, storage and client behavior still need consideration.

Can a read replica accept writes?

A standby/read replica is normally read-only until promoted to primary.

EKA YAZILIM VE BİLİŞİM SİSTEMLERİ

Design PostgreSQL HA around RPO, RTO and failover

Share DB size, write rate, acceptable data loss and RTO; we can design async/sync standbys and endpoints.

Ask on WhatsApp0850 307 34 58
WhatsAppCall NowExplore
Top