All tasks
Mediumsystem-designcachingread-heavy

Cache

Acceptance: —Solved by: 0

Statement

A news feed: 3000 requests per second, almost all reads (85 %). Even the largest database handles at most 3000 units per second and a write costs 3 units — so the database cannot take the reads alone. Attach a cache to the app server: a share of the reads (60–95 % depending on memory) never reaches the database. Cache misses go to the database. Spread the load with a load balancer over several server groups.

Constraints

  • p95 ≤ 250 ms, errors ≤ 0.1 %, budget $2800/month, ≤ 5 instances per node.

Requirements

SimulationBuild from scratch
p95
≤ 250 ms
Errors
≤ 0.10 %
Budget
$2,800/mo
Users
300,000
Your architecture costs$0 / $2,800

★ within budget · ★★ ≤ 75 % · ★★★ ≤ 50 % of the budget

Scenarios (checked in order)
  1. 1FeedLoad

    3000 requests/s for 60 seconds: 85 % reads, 5 % writes, 10 % static.

    60 s · 3,000 rps · R 85 / W 5 / S 10 %

  2. 2Breaking newsSpike

    From second 30, traffic grows 1.5× for 30 seconds (4500 requests/s).

    90 s · 3,000 rps · R 85 / W 5 / S 10 % · ×1.5 from s 30 for 30 s

Blocks

Click to add, or drag onto the canvas. Connect blocks by dragging from the right handle to the left one.

AI tutor

Stuck? Get a nudge — the tutor explains the idea, it never hands you the solution.

Solve this task to unlock the editorial.