Web apps · SDE-3 · Cache reads to fit a fixed peak budget
Black Friday system design, running live
Eight compute-optimized servers behind the load balancer carry 12,000 requests a second. A cache absorbs 90% of reads, so a primary and two replicas handle the rest. No CDN: at this request rate it alone would cost about ten times the budget.
An illustrative teaching design, not a verified diagram of any company's internal architecture. Traffic, capacity and cost are simulator estimates. Model and assumptions.
- Traffic
- 12,000 req/sLarge scale
- AWS bill
- $2,054/mo
- p99
- 83 ms
- Components
- 4
12,000 requests a second at peak with 2% writes. This is a static teaching preset; costs depend on the simulator's current price catalog.
How it works
- The load balancer spreads the peak across eight compute-optimized API servers.
- The cache answers most reads before they reach the database.
- The design omits the CDN because the challenge's request pricing exceeds its fixed budget assumption.
What each part does
- Users
- 12,000 requests a second, with 2% writes.
- API Server
- Eight c7g.xlarge API servers carry the peak traffic.
- Cache
- Cache for common product and page reads.
- Database
- Three database instances handle writes and cache misses.
What breaks first
The API tier is the first capacity limit as traffic rises.
The eight-server fleet is sized for the stated peak. A larger ramp eventually fills API capacity; measure CPU and request queues before changing instance size or count.
The simulator checks this every build: it runs the design at 12,000 req/s, then ramps traffic to 4x (48,000 req/s) and records which part fails first. In the playground, press Break it to watch the same thing happen.
Trade-offs
What it gets right
- A cache reduces database read work during a sharp shopping peak.
- The stateless API tier can scale horizontally.
What it costs you
- The cache adds an availability dependency and stale-data decisions.
- The fixed fleet has limited room for traffic beyond the preset.
In the real world
- Retail systems commonly cache product reads and plan capacity for a short sale peak.
- A static diagram cannot describe any particular retailer's internal architecture.
In the interview
- Separate peak load from daily average before sizing the API fleet.
- Compare CDN delivery cost with the byte and request volume before adding it.
Run it yourself
The playground opens this design with 12,000 requests a second already flowing. Press Break it, or change one part yourself, and watch which number goes first.
Questions people ask
How does Black Friday work at the system design level?
The load balancer spreads the peak across eight compute-optimized API servers. The cache answers most reads before they reach the database. The design omits the CDN because the challenge's request pricing exceeds its fixed budget assumption.
What breaks first in a Black Friday design?
The API tier is the first capacity limit as traffic rises. The eight-server fleet is sized for the stated peak. A larger ramp eventually fills API capacity; measure CPU and request queues before changing instance size or count.
What are the trade-offs of this Black Friday architecture?
A cache reduces database read work during a sharp shopping peak. The stateless API tier can scale horizontally. The cache adds an availability dependency and stale-data decisions. The fixed fleet has limited room for traffic beyond the preset.
What do interviewers look for in a Black Friday system design answer?
Separate peak load from daily average before sizing the API fleet. Compare CDN delivery cost with the byte and request volume before adding it.