Hands-on design challenge

Challenge 7: Upload events with bursts

The situation

Uploaders send events about their videos to an upload API, which writes each one straight to the relational video database. The database cannot keep up even at the usual rate, and a launch brings bursts far above it.

Traffic

3,000 requests a second.

OperationShareSteps
Read10%Read data
Write90%Write data
  • Read10%Read data
  • Write90%Write data

Data

A cache answers 85% of the reads that reach it.

What you are proving

You do not have to pay for the peak: a burst far above the usual rate is accepted in full, and the work it brings is finished soon after by a system sized for the average.

Rules

  • Events stay in the relational video database, and every write is stored in it.The records of the videos are already there.
  • A write only has to be accepted quickly; storing it can follow.Whoever uploads needs to know the event was received, not that it was processed.
  • A CDN cannot answer these requests.Each status is about one person's uploads, so no two people get the same response.

Builds on

Targets

  • Serve all 3,000 requests a second
  • At least 99.9% available, with no single point of failure
  • At most 2,900 USD a month
  • Every write kept in a relational database
  • Any tier loses one instance: nothing dropped, no tier over 80% busy
  • Traffic bursts to 5× for 60 s: nothing refused, backlog cleared within 300 s

Hints