HLD-119·Caching & Edge
Easy · 500 ptsDistributed Cache Proxy & Consistent Hashing Router
Design a Mcrouter/Twemproxy-style caching router that maps hot key lookups across sharded cache pools using consistent hashing while coalescing cold-key misses.
Max p99
≤ 28 ms
Availability
≥ 99.5%
Budget
≤ $3,200
Functional Requirements
- FR-1GET /cache/{cache_key} — Routes read to consistent-hash ring shard and coalesces concurrent misses.
- FR-2PUT /cache/{cache_key} — Writes value with TTL to backing store and updates shard ring.
- FR-3PATCH & DELETE /cache/{cache_key} — Updates, revokes, or deletes cache_key entries with bounded TTL or explicit cache/index invalidation.
- FR-4Must remain available and avoid origin thundering herds when a cache/storage node crashes.
Workload Profile
Baseline Lookups24,000 Read RPS / 1,500 Write RPS
Hot-Key Ring Burst64,000 Read RPS / 4,000 Write RPS
Active Working Set12 GB hot session & object cache
Traffic DistributionZipfian skew on popular cache_key prefixes
Consistency Model
Bounded eventual cache refresh (< 3s TTL/invalidation propagation); writes durably stored.
Relevant practice for
Solutions Locked
Sign in and either achieve AC or complete 3 official submissions on this question to inspect community diagrams and writeups.
Loading solutions...
Submission History (0)Select to replay
No submissions yet
Click Submit in the top bar to evaluate against all 7 judge cases and save each run here.
Click an item in Inventory above, or press B to add a component, double-click to name, C to connect.
Design Write-up
Write under ### Architecture for Diagram to take that up directly
Compulsory section · if not written yet, Diagram reads from the start of your write-up.
Architecture: required·FRs mentioned: 0/4·0 boxes · 0 edges
0 words