Streaming replication: the primary streams its WAL to standbys as changes happen, keeping replicas closely synchronized. Standbys can serve read queries and be promoted if the primary fails.
2 / 5
What is the difference between synchronous and asynchronous replication?
Sync vs async: synchronous replication guarantees no data loss on failover by waiting for a standby ack, at the cost of latency. Asynchronous is faster but a crash may lose the most recent unreplicated commits.
3 / 5
What is replication lag?
Replication lag: the time or byte gap by which a replica trails the primary. High lag means read replicas serve stale data and failover would lose more transactions. It is a key metric to monitor.
4 / 5
What is a read replica commonly used for?
Read replica: a standby that accepts read queries, spreading load away from the primary which handles writes. Applications route heavy reads to replicas, accepting slight staleness due to lag.
5 / 5
What is logical replication compared to physical replication?
Logical replication: instead of byte-for-byte WAL, it publishes change events per table. This permits replicating only chosen tables, between different major versions, and feeding other systems like data warehouses.