Myths and Truths about Synchronous Replication in PostgreSQL
summary
Explains WAL-based physical streaming vs log-shipping, exact effects of synchronous_commit (on, remote_write, remote_apply) and synchronous_standby_names (FIRST priority vs ANY quorum), shows commit is durable locally but visibility and lock release wait for confirmations so cancelled commits can become visible, recommends two‑phase commit or checking txid_status to detect this, warns zero‑RPO is not guaranteed, pg_rewind is still required, and benchmarks with docker-compose, iproute2 and pgbench show async ~5ms, quorum ~12ms, priority ~14ms and RTT=100ms pushes latency >100ms.
AI-written summary · about
chapters (8)
- 0:00Introduction
- 0:37Understanding Write-Ahead Log (WAL) and Replication Types
- 5:35Synchronous replication types
- 7:41Myth #1: Transaction Commit Order in Synchronous Replication
- 10:35Myth #2: Zero Data Loss Guarantees and RPO Claim
- 16:18Myth #3: Reading from synchronous standby nodes vs prim
- 19:34Myth #4: pg_rewind Requirements Even with Synchronous Setup
- 21:38Myth #5: Synchronous replication is slow
related talks
48mReplication Refresh
35mUnderstanding and Optimizing commit sychronization for maximum performance
25mWaiting for Commit
25mPostgres Storytelling: What's going on with Synchronous Replication?
31mPostgreSQL WAL and Commit Synchronization, Optimization Opportunities
33mFun with Postgres High Availability Poker
42mPostgreSQL Replication Conflicts: Avoiding Pitfalls
48mPostgreSQL Replication: 20 Pitfalls and Solutions
