All tasks
Hardsystem-designscalingcapstone

A flash sale for a million users

Acceptance: —Solved by: 0

Statement

An online store runs a flash sale for 1 000 000 users: the usual 3000 requests/s grow 8× to 24 000 requests/s for 30 seconds. 10 % static, 10 % writes (orders), the rest reads of product pages. This is the capstone: combine everything from the ladder. One load-balancer instance takes 20 000 requests/s — so does one cache instance. Orders must not be lost — push them through a queue and make sure it is empty by the end of the scenario. A cache absorbs the reads, replicas take the rest.

Constraints

  • p95 ≤ 300 ms, errors ≤ 0.1 %, queue empty by the end, budget $12 000/month, ≤ 10 instances per node, ≤ 20 blocks.

Requirements

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

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

Scenarios (checked in order)
  1. 1A normal dayLoad

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

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

  2. 2Flash saleSpike

    From second 30, traffic grows 8× for 30 seconds (24 000 requests/s); the queue must drain within the 240 seconds.

    240 s · 3,000 rps · R 80 / W 10 / S 10 % · ×8 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.