Scenario
Design a distributed key-value (KV) store.
Requirements
Functional
-
API:
-
Get(key) -> value | not_found
-
Put(key, value)
(optionally with versioning)
-
(Optional)
Delete(key)
-
Support many machines; data must be partitioned.
Non-functional
-
High availability and fault tolerance (node failures).
-
Low latency reads/writes.
-
Define consistency target (e.g., strong vs eventual) and justify.
-
Handle rebalancing when nodes are added/removed.
-
Discuss how you’d do replication, leader election, and failure recovery.
Assume values are small-to-medium (e.g., <= 1 MB) and keys are strings.