All scenes
Build a wide-column store (Cassandra / DynamoDB family)
13 scenes · ~91 min · build the primitive
Build your own wide-column store (Cassandra / DynamoDB family)
One server is not enough — disk fills, throughput maxes, the box dies. Build a multi-node store from first principles: hash sharding, the consistent-hash ring, vnodes, replication, eventual consistency, tunable W+R quorum, hinted handoff, read repair. Every modern Dynamo-style store is a point in this design space.
- 01One server, three ways to dieA single box hits a capacity wall, a throughput wall, and a death event — and your data is gone.~7 min
- 02Split keys with hash mod NHash the key, take it mod N, route to that server — keys spread evenly across the cluster.~7 min
- 03Adding a server remaps everythingWhen N changes from 4 to 5, almost every key's home changes — a cluster-wide migration.~7 min
- 04The ring — keys and nodes on a circleMap both keys and servers onto a circle; each key belongs to the next server clockwise.~7 min
- 05Vnodes flatten the lumpy ringGive each physical server many small ring positions; arcs become uniform and deaths spread their load.~7 min
- 06Copies on the next N serversStore each key on the next RF distinct servers clockwise so a node death loses no data.~7 min
- 07Replicas disagree, then convergeConcurrent writes hit replicas at different times; for a moment they disagree, but they converge under LWW.~7 min
- 08W plus R greater than NMake every read overlap every write on at least one replica by sliding two knobs.~7 min
- 09Partition forces a choiceSplit the cluster in two; one side keeps quorum, the other goes unavailable — or you accept divergence.~7 min
- 10Hold the write until it wakes upWhen a replica is briefly unreachable, the coordinator stashes the write and replays it on return.~7 min
- 11Heal on read, heal on a scheduleWhen a read sees disagreement, push the winner to stale replicas; on a cron, compare every key.~7 min
- 11aGossip keeps everyone informedEach node, every second, swaps state with a few peers; the cluster picture converges without a master.~7 min
- 12Design canvas — pick every knobGiven a real workload, pick partition key, RF, W/R, vnodes, and DC topology — and grade the result.~7 min