Problems / Design a product, hard

Build a distributed key-value store like DynamoDB

Design a DynamoDB-style key-value store from an empty canvas: route each key with consistent hashing to partitioned storage nodes, replicate it, and keep answering in milliseconds when a node dies or slows down.

Unlock it once for 25 credits; everything inside it is free (runs, changes, Submit, results, hints). Sign in with Google to start; new accounts get free credits.

What it must do

Scale

Request types to route: get (80%, read), put (20%, write). Budget: $1,400 a month.

Estimate first

The test cases

You start from an empty canvas. When you run the tests, each one simulates your design with its own traffic and failures:

TestWhat it doesPasses when
Normal dayThe normal day: the traffic in the brief, nothing broken.Success ≥ 99.9%; p99 latency ≤ 20 ms (get); p99 latency ≤ 40 ms (put)
Peak: 2× trafficAt 5 s traffic jumps to 2× normal for 8 s.Success ≥ 99%; p99 latency ≤ 30 ms (get)
A storage node diesAt 5 s a storage node on the request path crashes (the first one a request meets); it restarts 10 s later.Success ≥ 99.5% (get); Success ≥ 99% (put)
A storage node is 10× slowerAt 5 s a storage node on the request path (the first one a request meets) answers 10× slower for 8 s: a failing disk, a long compaction.Success ≥ 99%; p99 latency ≤ 20 ms (get)
Budget: $1,400/monthThe normal day's design must cost at most $1,400 a month.Cost ≤ $1,400/month

Must include

More design a product problems