Design a Key-Value Store
HardSystem design · Storage
Design a durable distributed key-value database in the style of Dynamo or Cassandra (and contrast it with Raft-based stores such as etcd). Clients put, get and delete values by key. Scale: 100TB of data, 500K reads/s and 100K writes/s, replication factor 3, p99 get under 10ms, node failures weekly. State a clear consistency contract and cover partitioning, replication, quorums, conflict resolution, hinted handoff and repair, the storage engine, and tombstones.
Requirements
- Partition data with consistent hashing and virtual nodes, replicating across failure domains
- Define the consistency contract: quorum settings, what a read can return, and what the store does on conflict
- Explain write durability: commit log, replication and what an acknowledgement means
- Keep replicas in sync with hinted handoff, read repair and anti-entropy, and handle deletes safely