WEBVTT

00:00:00.000 --> 00:00:03.100
Your app just went viral. Here's what breaks.

00:00:04.500 --> 00:00:07.600
100 users. One server. Life is good. App and database on one box.

00:00:09.200 --> 00:00:12.200
10,000 users. CPU maxed. Move the database out. Now each box does one job.

00:00:14.900 --> 00:00:17.200
100,000 users. Add a load balancer. Traffic spreads across 3 servers.

00:00:19.200 --> 00:00:21.800
250,000 users. Cache the hot reads. Redis answers in under 1 ms.

00:00:23.500 --> 00:00:26.400
500,000 users. Add read replicas. Writes hit the primary. Reads hit the copies.

00:00:27.600 --> 00:00:30.800
750,000 users. Serve files from a CDN. Images and JavaScript load from a server near the user.

00:00:32.000 --> 00:00:35.200
900,000 users. Queue the slow work. Emails and video encodes run in the background.

00:00:37.500 --> 00:00:40.200
1 million users. Shard the database. Split users by id across many machines.

00:00:40.600 --> 00:00:46.000
That's system design. Find the bottleneck. Remove it. Repeat. Save this for your next interview.
