Bugpit

Lessons › Real apps

Netflix: 65 million at once

At its biggest live event, Netflix reached 65 million streams at the same moment. You're running one thousandth of that: 65,000 viewers, and 20,000 req/s. Right now every second of video comes through your own servers.

Play this level

Free with an account. It runs in your browser: build the design, press Run, and watch what breaks.

The lesson

Netflix splits its system in two. It says everything before you press play runs in AWS: browsing, recommendations and encoding. Everything after you press play comes from its own CDN, Open Connect, which carries all of its video.

That split is the whole trick. Video is huge but never changes, so copies sit close to viewers. Your servers only answer the small questions, like what to show next.

A player fetches a few seconds of video at a time, so a viewer is a steady stream of small file requests. Here that's 80% of your traffic.

Video starts as one master file. An encoder makes versions for every screen and speed before anyone watches. And if recommendations fail, a viewer should still get to watch, so that service needs a circuit breaker.

What you have to achieve

20,000 requests a second at the busiest hour, 5% of them writes and 80% static files.

What you learn

Crash Recommendations: people keep watching. Now look at how little reaches your servers. Almost all the work happens at the edge, close to viewers. When a system looks impossibly big, ask which part truly has to come back to you.

The real numbers behind it

Check yourself

What does Netflix serve from its own CDN?

Show the answer

Everything after you press play: the video. Video is huge and never changes, so copies sit close to viewers. The servers answer only the small questions.

Recommendations crash. What should a viewer see?

Show the answer

The video keeps playing. A circuit breaker lets the page carry on without recommendations. Watching matters more.

Try it yourself

More in Real apps

← AWS: everything in one region Amazon: Prime Day →