~learn.
0:00 / 1:34
Case file · Hotstar

The peak didn't hurt Hotstar. The run out did.

transcript

25 point 3 million people watching. That wasn't the dangerous moment. The dangerous moment was one run out.

While you watch, your app does very little. It fetches the next few seconds of video. 49th over. Dhoni is run out. You're upset. You press back. The home page opens. Banner, continue watching, suggestions. Each one is an API call. Now millions press back in the same seconds.

Services that were quiet a second ago get flooded. A thundering herd. They hit the databases. The databases slow down. Pages are slow, so apps retry. The retries add even more load.

Hotstar learned this in 2017. India versus Pakistan. Kohli walks in. A notification goes out. The login API jumps from 10,000 to 125,000 requests a second. In seconds. Logins are hard to cache. The login database started to melt down.

So the cure lives in the phone. Hotstar called it No Dumb Clients. Jitter: a small random delay, so a million phones don't ask in one second. Backoff: after a failure, wait longer each time. And cache on the phone. A home page from ten minutes ago is fine.

Pre-scale the screen people flee to. Nobody knows when the wicket falls. The peak was fine. The drop is what hurts. Plan for the drop.

Full breakdown in the lecture.