Review cards · 18 cards
Replication
Leaders and followers, synchronous and asynchronous copies, and replication lag.
Cards
- Why is replication between distant regions usually asynchronous?
- A database is overloaded by writes. Why does adding read replicas not help?
- A primary takes 5,000 writes/s and replicates asynchronously, with the follower about 2 seconds behind. The primary's disk dies and the follower is promoted. Roughly how many acknowledged writes are lost?
- A config system sends every write through one root, which numbers the changes in order for its replicas. What does the single writer buy, and what must you add because of it?
- Replicating a disk to a standby versus replicating at the application level: what does the second give you?
- How do reads and writes work in leaderless (Dynamo-style) replication?
- A user sees a new comment, refreshes, and it is gone, because the second read went to a replica further behind. The guarantee that prevents this is _____.
- When a quorum read finds a replica with an older version and writes the newer value back to it, that is _____. A background process that compares replicas using _____ to find and fix differences is called anti-entropy.
- Reads peak at 60,000/s and one MySQL replica serves 20,000 reads/s. Keeping each replica at or under 75% even while one replica is down, how many replicas do you need?
- A user updates their profile, reloads, and sees the old version because the read went to a lagging replica. That breaks _____ consistency.
- Synchronous vs asynchronous replication: what does each give up?
- How long should followers wait without hearing from the leader before failing over? What does each choice risk?
- Replicas resolve conflicts with last write wins by timestamp. What can go wrong?
- With a leader in each region, what new problem appears, and how is it handled?
- After a failover with async replication, the old leader comes back with writes the new leader never got. What happens to them, and why is that risky?
- Related reads share an id, and hash(id) % N over the replicas picks the same replica for all of them. One replica goes down. How should the pick change so that other ids keep their replica?
- A leader has three followers. Which setup keeps writes fairly fast but still guarantees that every acknowledged write is on at least two machines?
- The old leader is cut off by a network partition, a follower is promoted, and now both accept writes. What prevents this split brain?
More topics
- Estimation 24 cards
- Networking 16 cards
- API design 17 cards
- Caching 24 cards
- Databases 23 cards
- Sharding 22 cards
- Consistency 19 cards
- Queues 21 cards
- Streaming 19 cards
- Availability 16 cards
- Resilience 17 cards
- Storage 14 cards
- Realtime 15 cards
- Data structures 16 cards
- Security 18 cards
- Observability 18 cards
- Coordination 17 cards