Optional capstone
Distributed key-value store
Consistent hashing, quorums, repair
Brief
Design (and ideally prototype) a Dynamo-style key-value store: GET/PUT over N nodes with no single point of failure, surviving node loss and network partitions while remaining available for writes. This optional capstone consolidates Part 8 into one artifact — every topic becomes a concrete mechanism.
Targets
Cluster of 6+ nodes · survives any single-node failure with no data loss beyond the configured quorum guarantee · adding or removing a node moves only ~1/N of keys · availability preferred over consistency during partitions (AP), with the consequences stated honestly.
Must cover
- Failure detection — gossip membership, slow vs. dead (→ 127).
- Quorums — configurable N/W/R and what W + R > N buys (→ 130).
- Repair — read repair, hinted handoff, Merkle-tree anti-entropy (→ 131).
- Conflict resolution — version vectors; siblings vs. last-write-wins, with the data-loss consequence stated (→ 134).
- Read and write paths — coordinator logic end to end (P).
- Correctness testing — kill nodes mid-write and show the quorum math hold (P).
Design challenges
- Placement (→ 74): consistent hashing with virtual nodes; replication to the next N − 1 distinct nodes on the ring; the rebalancing story when membership changes.
- Membership and failure detection (→ 127): gossip-based membership; what the cluster does when detectors disagree.
- Quorum reads and writes (→ 130): configurable N/W/R; sloppy quorums with hinted handoff (→ 131) and what they trade away.
- Conflict handling (→ 134): version vectors to detect concurrent writes; surfacing siblings to the client vs. last-write-wins.
- Anti-entropy (→ 131): Merkle-tree comparison for background repair; read repair on the hot path.
- The consistency contract (→ 128–129): document exactly what a client can and cannot assume — the exercise that makes CAP concrete.
Out of scope
Range queries and secondary indexes; transactions; multi-region (a single cluster teaches everything this capstone is for).
Expected output
The full 21-step document, plus — strongly recommended — a working prototype of challenges 1–4 in any language, exercised by killing nodes mid-write.