Replication
More copies for durability and reads, and the lag that comes with them.
Questions
Easy / Med / Hard
Your accuracy
Replication keeps copies of data on multiple machines for durability, read scaling, and failover.
Leader-follower is the common shape: writes go to one leader and propagate to followers that serve reads. Simple and effective, and it introduces replication lag — the window where a follower has not yet applied a write. Read your own write from a follower during that window and the data appears to have vanished, which is the single most common replication bug in production.
Synchronous vs asynchronous. Synchronous replication confirms a write only after a follower acknowledges it, so no data is lost on leader failure and every write pays the slowest follower's latency. Asynchronous is fast and loses recent writes if the leader dies before propagating. Semi-synchronous — one synchronous follower, the rest async — is the usual compromise.
Multi-leader lets several nodes accept writes, which helps across regions and creates write conflicts you must resolve. Last-write-wins is easy and silently discards data. Leaderless (Dynamo-style) uses quorums: with N replicas, if W + R > N, reads and writes overlap on at least one node and you read the latest value.
Failover is where the sharp edges are. Promoting a follower that was behind loses writes. Two nodes both believing they are leader is split-brain, and it corrupts data quietly rather than loudly.
What actually travels. Statement-based replication ships the SQL and re-runs it, which is compact and breaks on anything non-deterministic — NOW(), a random value, an auto-increment race. Row-based (logical) replication ships the resulting row changes, which survives differing schemas and versions and is what makes change-data-capture pipelines possible. Physical (WAL) replication ships storage-level changes, which is the fastest and requires the replica to be a byte-compatible copy of the same engine version.
Replication is not a backup. A replica faithfully applies whatever the leader did, including the DELETE with the missing WHERE clause, and it applies it within seconds. Replication protects you from a machine dying. Backups and point-in-time recovery protect you from a person or a deploy, and the only meaningful test of a backup is a restore you have actually performed.
Read replicas do not scale writes. Every replica applies the entire write stream, so adding one raises read capacity, leaves write throughput exactly where it was, and adds load to the leader feeding it. When writes are the constraint, more copies is the wrong shape of answer; partitioning is the right one.