Database Replication Deep Dive: synchronous vs async vs semi-sync replication, WAL/binlog/oplog physical streaming, cascading and delayed replicas. Topology shows app writer/reader, Postgres leader, sync replica (remote_apply), two async replicas, plus a DR/cascading group with intermediate replica feeding cascaded replicas and a 1h delayed replica. Five scenarios: (1) sync commit waiting for replica ack, (2) async stale read pitfall (read-your-writes violation), (3) MySQL semi-sync silent degrade to async on timeout with crash, (4) read-your-writes routing using LSN to leader, (5) delayed replica rescuing from human-error DELETE.
Replication is several contracts, not one checkbox: where a write is durable when success returns, when a standby has replayed it, which replica may serve a session read, how a leader is elected, and how the old writer is fenced. Each contract has a different threshold and failure path.
PostgreSQL synchronous replication can wait for a priority (FIRST) or quorum (ANY) number of named synchronous standbys. There is no built-in synchronous_commit_timeout that automatically and safely downgrades a blocked commit to asynchronous success. An operator may explicitly change configuration or cancel work, but that is a policy transition with changed durability.
FIRST n waits for priority standbys and ANY n waits for a quorum count; neither universally means every listed standby.remote_write, on, and remote_apply represent different acknowledgement/visibility stages.synchronous_commit_timeout parameter.Quorum synchronous acknowledgement. ANY 1 of two candidates is an explicit example; success means that threshold, not replay everywhere.
Required synchronous standby loss. A commit can block until a standby returns or an explicit operator policy changes; there is no automatic timeout downgrade.
Asynchronous RPO window. Local success can precede DR receipt, so an acknowledged write can be absent after a primary-site loss.
Read-after-write replay barrier. Standby receipt is insufficient; routing waits for apply position or returns to the writer.
Fenced failover. An eligible candidate is promoted only after the old writer loses write authority; then the endpoint moves.
Введите числа или выберите пресет