All tasks
Mediumsystem-designfixdatabase

Fix it: the slow database

Acceptance: —Solved by: 0

Statement

You inherit a running system: a load balancer, three server groups and a tier “m” database. Fine by day, but in the evening at 2000 requests/s (85 % reads) users complain about timeouts. Change the diagram so it meets the SLO again. There are several fixes: scale the database vertically, add a cache or a replica. The budget is $2000; the cheaper, the more stars.

Constraints

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

Requirements

SimulationFix it
p95
≤ 250 ms
Errors
≤ 0.10 %
Budget
$2,000/mo
Users
80,000
Your architecture costs$925 / $2,000

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

Scenarios (checked in order)
  1. 1DaytimeLoad

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

    60 s · 800 rps · R 85 / W 5 / S 10 %

  2. 2EveningLoad

    2000 requests/s for 90 seconds: this is when the timeouts start.

    90 s · 2,000 rps · R 85 / W 5 / S 10 %

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.