System design lab Beta
Each level is a system in trouble. Add components, run traffic and see what breaks, then fix it within budget.
The lab is in beta. Levels and numbers may change, and your stars are kept.
0 / 30 stars
No levels passed yet. Progress stays in this browser and is never sent.
Basics
- You're opening to your first 1,500 requests per second. Someone added two extra servers last night, but users say the app is still slow. Serve every request without going over budget.Teaches: Load balancing, Horizontal scaling
Level 1. Soft launch
BeginnerNext upPlay - Your load balancer from Soft launch is in place. Now the app got featured: about 2,000 requests per second arrive, and 90% of them are reads. Serve every request without going over budget.Teaches: Horizontal scaling, Vertical scaling, Caching, Read replicas
Level 2. Launch day
Beginner
Databases
- Concert tickets go on sale at noon. 2,000 requests per second hit your app, and 60% of them are purchases: writes. Serve every request without going over budget.Teaches: Database writes, Vertical scaling, Caching, Read replicas
Level 3. Ticket drop
Intermediate Level 4: News spike
Teaches: A cache beats more database for read-heavy trafficComing soon
Servers
Level 5: Legacy app
Teaches: Stateful servers scale up, not outComing soonLevel 6: Cost cut
Teaches: Right-sizingComing soon
Failures and scale
Level 7: The server dies
Teaches: Redundancy, single points of failureComing soon
Build an app
Build the backend of a real kind of app, one level at a time. Each level starts from the last one's winning design, so you watch one system grow.
Photo app
Build the backend of a photo app as it grows, from its first uploads to a photo everyone wants to see.
- You're building a photo app. People scroll a feed, open photos and post their own: 1,000 requests per second in all. Right now every photo is stored in the database. Serve every request without going over budget.Teaches: Object storage
Photo app, level 1. Photo uploads
Beginner - Your photos are in object storage from Photo uploads. Now one photo went viral: 8,000 people a second are opening it, on top of the feed and new posts. Serve every request without going over budget.Teaches: CDN
Photo app, level 2. Viral image post
Beginner - Your CDN from Viral image post is in place. Now every new photo needs three smaller sizes for the feed, and resizing an image is slow. Right now each post waits while its server resizes it. Serve every request without going over budget.Teaches: Queues, Background jobs
Photo app, level 3. Thumbnails
Beginner
Music app
Build the backend of a music app with millions of listeners, from one pool of servers to services, partners and a stream of every play.
- You run a music app. At the evening peak, 1,800 people a second press play and 600 search, and a search costs five times the work of a play. Every server runs everything, and the budget can't cover it all. Songs must always play; search can slow down, as long as half of searches get through.Teaches: API gateway, Services, Graceful degradation
Music app, level 1. Split the monolith
Intermediate - Your services from Split the monolith are in place. Now your music app shows lyrics while a song plays: 1,500 requests a second, each asking a lyrics partner. The partner allows only 400 calls a second, and you can't buy more. Keep every service at its share without going over budget.Teaches: Third-party APIs, Caching
Music app, level 2. Lyrics partner
Intermediate - Your lyrics partner from the last level is in place. Now the music app counts every play for artists' analytics: each play sends 2 events, 3,600 a second, and today each one is written to the database. Keep every service at its share without going over budget.Teaches: Event streams, Stream processing
Music app, level 3. Play counts
Intermediate - Your event stream from Play counts is in place. Now likes and skips count too, 4 events per play, 7,200 a second, and a new Recommendations group must read every one of them, as Analytics does. Keep every service at its share without going over budget.Teaches: Event streams, Partitions
Music app, level 4. Recommendations
Intermediate