All tasks
Mediumsystem-designdatabasereplication

Replicas for the feed

Acceptance: —Solved by: 0

Statement

A social feed: 4000 requests/s, 90 % reads. A cache is off-limits in this product (data changes every second), so the only way to take reads off the database is read replicas. A replica serves reads only and must be linked to the primary; the app server splits reads evenly across live replicas. Writes go to the primary only. Evenings bring 1.3× the load.

Constraints

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

Requirements

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

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

Scenarios (checked in order)
  1. 1Daytime feedLoad

    4000 requests/s for 60 seconds: 90 % reads, 5 % writes, 5 % static.

    60 s · 4,000 rps · R 90 / W 5 / S 5 %

  2. 2Evening peakSpike

    From second 20, traffic grows 1.3× for 60 seconds (5200 requests/s).

    100 s · 4,000 rps · R 90 / W 5 / S 5 % · ×1.3 from s 20 for 60 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.