Single Write Source: All writes through master only
Architecture Components
Master Node (Primary/Leader)
Writes: Accepts all INSERT, UPDATE, DELETE, DDL operations
Reads: Can serve read queries
Replication Log: Generates change log for replicas
Backup Nodes (Replicas/Standby)
Read-Only: Serve read queries, no direct writes
Replication: Apply changes from master
Lag: May be behind master (eventual consistency)
Replication Methods
Synchronous Replication
Process: Master waits for replica confirmation before commit
Trade-off: No acked-commit loss on failover, but higher write latency. Replica reads can still be stale unless the master waits for the replica to apply the change (Postgres synchronous_commit = remote_apply)
Use Case: Critical data requiring consistency
Asynchronous Replication
Process: Master commits immediately, replicas catch up later
Trade-off: Low latency but potential data loss on failure
Use Case: High performance requirements
Semi-Synchronous Replication
Process: Wait for at least one replica confirmation
Trade-off: Balanced consistency and performance
Use Case: A MySQL feature (Postgres has no semi-sync mode; it uses sync with ANY 1 (...) quorum or async)