open atlas
↑ Back to track
System Design Foundations SD · 04 · 05

Data distribution: multiple-choice review

Multiple-choice synthesis across the data-distribution unit: replication lag and lost writes, partitioning strategies and the hot shard, consistent hashing vs mod-N, and the CAP/PACELC choice per use case.

SD Senior ◷ 13 min
Level
FoundationsJuniorMiddleSenior

Six questions that cut across the whole unit. Each is a decision you make when you choose a replication mode, pick a partition key, route keys to nodes, or label a data store’s consistency — not a definition to recite, but the trade-off a senior engineer commits to under a real failure.

Confirm you can trace a lost write through an async failover, diagnose a hot shard from a partition key, pick consistent hashing over mod-N, compute a quorum overlap, and place a workload on the consistency spectrum with CAP and PACELC straight.

Quiz

An async-replicated database acknowledges writes #51–53 to clients, then the leader crashes having shipped only up to #50. A follower at #50 is promoted. What is the correct description?

Quiz

You shard users by user_id, evenly by count. One shard pins at 100% CPU while the rest idle, right after a celebrity account went viral. What's happening, and the cleanest mitigation?

Quiz

A Redis cache fleet routes keys with hash(key) mod N. Adding one node (N: 16 → 17) collapses the hit rate to near zero. What's the fix and why does it work?

Quiz

A leaderless store has N = 5 replicas. You want a read to be guaranteed to see the latest acknowledged write. Which (W, R) pair achieves this with the most write availability?

Quiz

A teammate says 'we run Cassandra, so we're AP — we gave up consistency.' Using CAP and PACELC precisely, what's the most accurate correction?

Quiz

You're choosing a consistency level per data type for one product. Which assignment reflects the unit's 'pick per use case' principle?

Recall before you leave
  1. 01
    Why can an async-replicated failover lose acknowledged writes, and what prevents it?
  2. 02
    Give the minimum quorum for a guaranteed-fresh read with N = 5 and the most write availability.
Recap

The through-line is that distributing data is a series of choices about which disagreement you can tolerate. Replication copies data for reads and survival, but async replication acks before durability, so a failover can lose acknowledged writes — keep a synchronous replica. Sharding splits data by a partition key, and an even key count still produces a hot shard under skew (the celebrity), fixed by splitting, caching, or isolating the hot key. Consistent hashing routes keys on a ring so adding a node moves only ~1/N of keys, where hash mod N would remap nearly all of them and wipe a cache. Leaderless quorums guarantee a fresh read when R + W > N (the read and write sets overlap). And CAP is only the partition-time C-vs-A choice while PACELC adds the everyday latency-vs-consistency trade — so you pick per use case: linearizable for money and inventory, eventual for like counts and feeds, read-your-writes for a user’s own edits.

Something unclear?

Ask a question about this lesson. Questions are anonymous and go straight to the author to make the lesson better.

shortcuts expand
search
K
prev piece
k
next piece
j
cycle tier
t
this menu
?
sources3
expand
  1. 01
  2. 02
  3. 03

Trademarks belong to their respective owners. Editorial reference only.