Key-Value Store

COMMON

Key-value store design is asked at Amazon, Google, and Meta because it tests storage engines, replication, and consistency trade-offs in one problem. It is the design behind DynamoDB, Cassandra, and Riak: the systems holding carts, sessions, and device state that must never refuse a write. You will design an LSM storage engine that sustains 10K writes/sec per node by making every disk write sequential, a consistent-hash ring that places 100 billion keys with no metadata service, and tunable quorums (R + W > N) with hinted handoff, vector clocks, and Merkle-tree repair.

  • Design an LSM storage engine (WAL + memtable + SSTable) that sustains 10K writes/sec per node
  • Apply quorum math (R + W > N) and explain why overlap guarantees intersection, not agreement
  • Choose between LWW and vector clocks, and name the clock-skew failure that silently loses writes
AmazonGoogleMetaLinkedInNetflixDatastax
8
Concepts
Deep dives
10
Cheat Items
Quick ref
Elevator Pitch3-minute interview summary

I would design a Dynamo-class key-value store holding 100 TB (100 billion keys) on 500 nodes, serving 20M reads and 5M writes per second. The LSM engine makes every disk write sequential: WAL append plus memtable insert, flushed as immutable SSTables, giving 10K writes/sec per node at the cost of 10x compaction amplification, with bloom filters (10 bits/key, 1% false positives) keeping reads to one seek. A consistent-hash ring with 256 vnodes places keys and N=3 replicas with no metadata service. Quorums tune consistency per request: R+W>N for fresh reads. Sloppy quorums with hinted handoff keep writes flowing through failures, and read repair plus weekly Merkle anti-entropy converge replicas afterward.

Concepts Unlocked8 concepts in this topic