Hotstar is a popular Indian ๐ฎ๐ณ digital and mobile entertainment platform ๐บ. It offers a wide range of digital media content, including TV shows, movies ๐ฌ, and sports events (such as cricket matches ๐ from the Indian Premier League and other sports tournaments).
Have you ever checked in live cricket ๐ matches ๐บ, there is a count on top, like 67L Viewers ๐.
Have you ever wondered how Hotstar handles this huge traffic? ๐
In 2019, During the ICC World Cup Semi-Final between India and New Zealand ๐, Hotstar set a new record of 25.3 million viewers. Similarly, Hotstar set a new record of 35M concurrent users during the recent IND vs PAK World Cup 2023. That was a huge count.
Challenges faced by Hotstar
In 2019 when Dhoni came for batting ๐ sudden spike ๐ was noticed in traffic, taking it to 25.3M concurrent users. But then Dhoni got out, and there was a drastic drop ๐ from 25.3M to less than 1M.
There is first challenge is to handle such sudden spikes ๐ and drops ๐ also when users are dropped, some of them exit from the app entirely and others return to the homepage. that leads to an increase in load on homepage services.
-> Challenges with autoscaling.
-> Load testing for millions.
-> Chaos engineering at a high level.
How did Hotstar overcome these challenges?
โข Autoscaling: Hotstar does not use traditional autoscaling from AWS because it comes with challenges ๐งฑ, such as insufficient capacity errors โ, single instance type per auto-scaling group, and step size autoscaling groups. Instead of this Hotstar uses custom scaling policies that are traffic-based ๐ฆ and ladder based ๐ช. It allowed automated pro-active scale-up buffers to handle the sudden spikes ๐.
โข Load testing: For load testing, Hotstar has project HULK. Project HULK is an in-house performance ๐๏ธ testing framework developed by Disney+ Hotstar. It allows Hotstar's engineers โ๏ธ to simulate the entire user journey with different inputs and can also simulate entire traffic patterns. This helps them to identify ๐ฌand fix potential bottlenecks and performance issues before they affect real users.
โข Content delivery network ๐: Hotstar uses a CDN ๐ to deliver content to users from servers that are located close to them ๐ก. This helps to reduce latency and improve the streaming experience for users.
โข Chaos Engineering ๐ ๏ธ: Chaos Engineering ๐ ๏ธ can be used to identify ๐ and mitigate single points of failure in Hotstar's system ๐ฅ๏ธ. By using Chaos Engineering to test the system's ability to handle these different types of failures.
Panic Mode ๐ด:
Hotstar uses panic mode when it experiences a major outage or disruption. It turns off ๐ซ non-critical services and graceful degradation, P0 services must be always up.