SystemKit

Replication and Read Consistency

Copies are how databases survive failure, and also why users see stale data. Covers synchronous and asynchronous replication, read-your-writes, failover and split brain, and how to choose among single-leader, multi-leader, and leaderless designs.

Lessons

  1. 01Send every write through one leaderReplication keeps copies of changing data, and the acknowledgment rule decides what a crash can lose.
  2. 02Show users their own writesA read from a lagging follower can hide a change the user just made, and there are several ways to prevent it.
  3. 03Keep reads moving forward and in orderTwo more anomalies appear when reads hit different followers or shards, and each has a specific fix.
  4. 04Replace a failed leader safelyPromoting a new leader is routine, but it can lose acknowledged writes and leave two nodes that both accept them.
  5. 05Accept writes in more than one placeSeveral leaders give local writes and regional independence, in exchange for conflicts discovered after the fact.
  6. 06Choose among leaders and quorumsLeaderless quorums remove failover, and the choice among the three models comes down to what concurrent writes mean for your data.