Keeping copies consistent.
WHAT REPLICATION DOES
Maintains copies of data on several systems.
WHAT SYNCHRONOUS MEANS
A write is not acknowledged until replicas have it.
What it provides: no data loss on failure.
What it costs: latency, and unavailability if a replica is unreachable.
WHAT ASYNCHRONOUS MEANS
A write is acknowledged immediately, replicated afterwards.
What it provides: speed, and tolerance of replica unavailability.
What it costs: potential loss of recent writes on failure.
WHAT TO CHOOSE
Depends entirely on whether losing recent writes is acceptable.
WHAT REPLICATION LAG IS
How far behind a replica is.
WHY IT MATTERS
Reading from a lagging replica returns stale data.
WHAT THAT CAUSES
A user writing something and then not seeing it.
WHAT TO DO ABOUT IT
Read from the primary after a write, where it matters.
WHAT TO MONITOR
Lag, continuously, with alerts.
WHAT FAILOVER REQUIRES
Promoting a replica, and redirecting clients.
WHAT TO DECIDE
Whether that is automatic or manual.
WHY MANUAL IS DEFENSIBLE
Automatic promotion during a network partition can cause split-brain.