System Design ( Day - 31 )

Manoj KumarManoj Kumar
4 min read

How JioCinema live Stream to 20 million users during IPL?

Its’ not the Complete System design it actually a discussion on how JioCinema streams to 20 million active users during the IPL season.

If the IPL starts from March then the JioCinema Team will start working of the Next IPL before 3 - 4 months like from November or December like that, they have to make things right, to make infra scalable, and a stable frontend with scalable backend which server 20 million device at a same time, then imagine how they are going to do that, they are going to test each and everything like they have to find out the breaking point of the each service that they have, they have to audit the frontend, backend, CDN’s, loadbalancers, infra scalability, databases, they have to take care of everything before the IPL season and test through applying load, stress to the current systems, and freeze the code changes before going to production, they have to analyse the metrics, alerts during Stream and they have to run a bunch of scenarios for the failures that are happening during the scenario and try to tackle that errors and failures before the actual match day so that the users won’t get any of the disturbance during the Match that’s the main goal. . There will be a lot of headache for the Team during the IPL seasons.

FrontEnd
From the FrontEnd audit, they do like, if that feature is not really required for the match day then it going to freeze on the match day to increase the other features to work properly, and if any error persist then we don’t want to show to the user like oops something went wrong, please try again, that error should be escalated to appropriate teams through the matrices or logs, so that they can fix them without telling to customers, because may of the production apps show that error and tell them to try again, during the match day if we gave like that, then the server is definitely going to fail because, already the server is in too much load if we gave everyone to retry then it would be double load to the server and that is going to definitely crash. that shouldn’t happen at all. when it comes to turning on and off the features, it would depends on the application version of the end user, it this feature is crashing for the particular app version of the particular android version then that feature could turned off until the team fixes it or until the match completes.

Infrastructure
While designing the System there would be a Loadbalancers which are handling the incoming requests to the servers, the server contains different different services may be for each features or something like that, these could have more micro services that are already scaled before the match, because auto-scale won’t work for these kind of systems, for auto-scale it’s going to gradually increase the servers, but for us users are going to hit us when match starts, minimum auto - scale will take up to 40 minutes to scale the servers, that is not going to work for the jioCinemas, they have to prescale the database and servers before starting of the match, when it comes to Database that is the crucial part for scaling because it’s going to take high load during the match, the team will run some scenario and get the rough sketch about how much db scale is needed and how much has to be scaled, and that has to be discussed with the cloud provides to get the access
When something goes down before the match, they’ll take a snapshot of the services and store it in a separate CDN if anything goes wrong other that the stream then the request that are coming for other things are routed to that CDN to avoid avoid the errors and failures. While scaling down the servers and DB, they won’t do it in the match session, after the match depending on the active users the scale will be reduced.

Multi CDN’s
JioCinema uses Multi CDN to distribute the load on the CDN’s because obviously 1 CDN has their limits and processing and memory mgt, they can’t go beyond that limits, they are having multiCdnOptimizer to check the load on the CND’s and route them to other CDN’s, and also Caching policy at CDN is also important like LRU, MRU according to the need of the Jio.

Ads
When coming to ads, the ads are pushed to the users manually my the operator, during the match period, that ads are pushed from the backend to application, that would be slightly personalised depending on the region of the user and the recommendation system.

0
Subscribe to my newsletter

Read articles from Manoj Kumar directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Manoj Kumar
Manoj Kumar