This challenge builds on Cake Shop 1 - Going Online. Complete it first for the best experience.
Sweet Crumbs Bakery went viral after a celebrity posted about their red velvet cake. Traffic has grown 50× overnight - from 10 k to 500,000 daily visitors. The single-server setup from Challenge 1 is buckling under load.
Maya has secured funding and hired two more developers. She needs:•The catalog to remain fast even under heavy read traffic.•Orders to be reliably accepted without data loss, even during surges.•Static assets (high-res cake photos) to load quickly for users everywhere.
Redesign the architecture to handle this new scale while keeping costs reasonable.
The bakery goes viral on social media. Handle 500 k daily visitors with caching and load balancing. Build this architecture under realistic production constraints, then validate tradeoffs in the design lab simulation.
Clarify requirements: Growing from 10k to 100k daily visitors. Same feature set but now peak traffic (3x) overwhelms a single server.
Estimate scale: 100k DAU / 86,400s ~= 1.2 RPS average. 3x peak ~= 3.5 RPS. A cache and a second API server are warranted.
Pick components:
Key tradeoffs to discuss:
At 100k DAU, add a load balancer to distribute across multiple API servers and a Redis cache to absorb product catalog reads. The load balancer also enables zero-downtime deploys. Redis must store sessions so any API instance can serve any user. CDN continues to handle static assets. PostgreSQL remains the single source of truth.