<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[anurath_02_Load_balancer_in video streaming]]></title><description><![CDATA[anurath_02_Load_balancer_in video streaming]]></description><link>https://anurath02.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Mon, 26 Oct 2026 22:06:41 GMT</lastBuildDate><atom:link href="https://anurath02.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[How Do servers handle massive traffic using Load Balancers?]]></title><description><![CDATA[Introduction In the previous part of this series, we explored how a CDN(Content delivery network) help deliver videos from servers to users with low…]]></description><link>https://anurath02.hashnode.dev/how-do-servers-handle-massive-traffic-using-load-balancers</link><guid isPermaLink="true">https://anurath02.hashnode.dev/how-do-servers-handle-massive-traffic-using-load-balancers</guid><dc:creator><![CDATA[Sai Anurath Eshwarapragada]]></dc:creator><pubDate>Mon, 08 Jun 2026 09:08:30 GMT</pubDate><content:encoded><![CDATA[<img src="https://cdn.hashnode.com/uploads/covers/6a1122211f237623ea5bd184/84578c7e-bf8c-4fa8-8824-4cf4b120f4a0.png" alt="" style="display:block;margin:0 auto" />

<p><strong>Introduction</strong></p>
<p>In the previous part of this series, we explored how a CDN(Content delivery network) help deliver videos from servers to users with low latency and minimal buffering .</p>
<p>We also looked at the step-by-step workflow of how a CDN works behind the scenes to serve millions of viewers efficiently.</p>
<p>Now , let's move to the next piece of this puzzle.</p>
<p>NOTE: If you haven't read the previous blog in this series , I recommend checking out <a href="https://anurath01.hashnode.dev/how-millions-of-users-watch-ipl-on-jiohotstar-without-crashing-the-servers">Part 1</a> before continuing.</p>
<p><strong>A Brief History of Load Balancers</strong></p>
<p>In the early days of the internet, websites ran on a single server and traffic was manageable. But as internet adoption exploded through the late 1990s and 2000s, that single server model started cracking under pressure.</p>
<p>The first solution was hardware load balancers -physical devices that sat in front of servers and distributed incoming traffic. Companies like <strong>F5 Networks</strong> pioneered this space with dedicated appliances that could handle high volumes of requests. These devices worked well, but they were expensive, difficult to scale, and required manual configuration.</p>
<p>As cloud computing matured, the industry shifted toward <strong>software-defined load balancing</strong> -load balancers that run as software rather than dedicated hardware. This made them dramatically cheaper, faster to deploy, and infinitely more flexible.</p>
<p>Today, cloud providers like AWS, Google Cloud, and Azure offer fully managed load balancing services that can scale automatically, handle millions of requests per second, and require almost no manual intervention. For platforms like JioHotstar, this evolution was critical it's what makes serving 50+ million concurrent viewers during an IPL final even possible.</p>
<p><strong>How servers handle massive traffic using Load Balancers?</strong></p>
<h3><strong>Concept</strong></h3>
<p>A load balancer is a system that distributes and balances the incoming traffic among the servers to provide high availability, efficient utilization of servers and high performance.</p>
<p>Let's understand how a Load Balancer works using a simple analogy.</p>
<h3>Analogy</h3>
<img src="https://cdn.hashnode.com/uploads/covers/6a1122211f237623ea5bd184/8b6678a4-9209-478d-b6db-b2ed5e8e931b.png" alt="" style="display:block;margin:0 auto" />

<p>Imagine a busy restaurant .Customers keep walking in through the door. And the restaurant has three waiters(waiter A,B,C).If every single customer ran straight to waiter A, that poor waiter would collapse while the other two stand around doing nothing.</p>
<p>So the restaurant tries to place a person/host at the entrance. Here the job of host is simple but effective He will be monitoring each waiters current load, sends the next customer to whoever is free and he never sends customers to an already drowning waiter.</p>
<p>Now coming back to the topic .Here</p>
<p>Customers represent internet traffic.</p>
<p>Waiters represent servers.</p>
<p>The host standing at the entrance acts as the <strong>Load Balancer.</strong></p>
<p>The result : No single waiter will sit idle, every customer gets served and restaurant handles 3x crowd at once.</p>
<p>So that's essentially how a Load Balancer works. making sure no single server gets overwhelmed while others sit idle. when one server crashes, the host stops people there and redistribute to the rest. the customers don't even notice.</p>
<p>Now that we understand the basic concept of a Load Balancer, let's see why it becomes so important for large scale streaming platforms like Jio Hotstar.</p>
<p>During an IPL match, millions of users may join the stream within a matter of seconds. Handling such massive traffic reliably requires much more than a powerful server—it requires intelligent traffic distribution.</p>
<h2>Benefits of Load Balancing in Video Streaming</h2>
<p>Load balancing plays a crucial role in helping streaming platforms handle millions of users efficiently. Some of its major benefits include:</p>
<h3>1. Enhanced Performance and Better Streaming Quality</h3>
<p>A Load Balancer distributes incoming traffic across multiple servers instead of sending everything to a single server.</p>
<p>As a result:</p>
<ul>
<li><p>Servers process requests faster.</p>
</li>
<li><p>Users experience lower latency.</p>
</li>
<li><p>Buffering is reduced.</p>
</li>
<li><p>Video playback becomes smoother.</p>
</li>
</ul>
<p>For example, during an IPL match, millions of viewers may join the stream simultaneously. Load balancing ensures that this traffic is spread across multiple servers, preventing performance degradation.</p>
<h3><strong>2.High Availability and Reliability</strong></h3>
<p>Streaming platforms cannot afford downtime, especially during live events.</p>
<p>Load Balancers continuously monitor the health of backend servers. If a server becomes slow, unresponsive, or completely fails, the Load Balancer automatically redirects traffic to healthy servers.</p>
<p>This ensures that:</p>
<ul>
<li><p>The streaming service remains available.</p>
</li>
<li><p>Users experience minimal disruption.</p>
</li>
<li><p>Single server failures do not bring down the entire platform.</p>
</li>
</ul>
<h3>3. Seamless Scalability</h3>
<p>Traffic on streaming platforms is highly unpredictable.</p>
<p>Load Balancers make it easy to add new servers whenever traffic increases. Once a new server is added, the Load Balancer automatically starts sending traffic to it.</p>
<p>This allows platforms to:</p>
<ul>
<li><p>Handle sudden traffic spikes.</p>
</li>
<li><p>Maintain consistent performance.</p>
</li>
<li><p>Scale infrastructure without affecting users.</p>
</li>
</ul>
<h3>4. Efficient Resource Utilization</h3>
<p>Without Load Balancing, some servers may become overloaded while others remain underutilized.</p>
<p>A Load Balancer ensures that traffic is distributed evenly across available servers, making better use of computing resources and improving overall system efficiency.</p>
<h3>5. Better User Experience</h3>
<p>The ultimate goal of Load Balancing is to provide a seamless experience for viewers.</p>
<p>By reducing server overload, improving availability, and minimizing latency, users can enjoy uninterrupted streaming even during high-traffic events.</p>
<p>For platforms like JioHotstar, this means millions of viewers can watch live matches simultaneously without experiencing significant buffering or service interruptions.</p>
<h3><strong>Can a Load Balancer Become a Single Point of Failure?</strong></h3>
<p>💡If the Load Balancer itself fails, won't the entire system fail? In production systems, organizations deploy multiple Load Balancers across different Availability Zones. Cloud providers like AWS automatically ensure redundancy, preventing the Load Balancer from becoming a single point of failure.</p>
<h3><strong>Step by Step Workflow of Load Balancing In Video Streaming.</strong></h3>
<h3>Step 1: User Ope<strong>ns JioHotstar</strong></h3>
<p>A user opens the Jio Hotstarapp and clicks on an IPL live stream.</p>
<img src="https://cdn.hashnode.com/uploads/covers/6a1122211f237623ea5bd184/c327d952-71e1-4f94-85f3-3221ef3a42ab.png" alt="" style="display:block;margin:0 auto" />

<h3>Step 2: Request Reaches the Load Balancer</h3>
<p>Instead of directly contacting a backend server, the request first reaches the Load Balancer.</p>
<img src="https://cdn.hashnode.com/uploads/covers/6a1122211f237623ea5bd184/e268672a-efb3-405d-b765-ce2c22615ff6.png" alt="" style="display:block;margin:0 auto" />

<p>The Load Balancer acts as the entry point for all incoming traffic.</p>
<h3>Step 3: Load Balancer Checks Server Health</h3>
<p>The Load Balancer continuously pings all servers with health checks. It maintains a live registry: which servers are healthy, which have failed, and how loaded each one is.</p>
<img src="https://cdn.hashnode.com/uploads/covers/6a1122211f237623ea5bd184/44be29af-920d-47ab-9a2f-17b1770cf846.png" alt="" style="display:block;margin:0 auto" />

<h3>Step 4: Best Server is Selected</h3>
<p>The Load Balancer doesn't randomly pick a server. It uses a <strong>routing algorithm</strong> to make an intelligent decision every single time a request arrives. The three most commonly used algorithms are:</p>
<p><strong>Round Robin</strong> Requests are distributed to each server one by one in a fixed rotation. If there are three servers A, B, and C ,the first request goes to A, the second to B, the third to C, and then the cycle repeats. This works well when all servers have similar capacity and the requests are roughly equal in complexity.</p>
<p><strong>Least Connections</strong> Instead of rotating blindly, this algorithm sends each new request to whichever server currently has the fewest active connections. This is smarter than Round Robin because it adapts to real workload — if Server A is handling 500 active streams and Server B only has 100, new traffic automatically goes to Server B. This is particularly useful for video streaming where some sessions last much longer than others.</p>
<p><strong>Least Response Time</strong> This algorithm routes traffic to whichever server is responding the fastest at that moment. It combines both active connection count and actual server response speed to make its decision. For a live streaming platform like JioHotstar, where even a 100ms delay can cause buffering during a critical IPL over, this algorithm ensures users are always connected to the most performant server available.</p>
<img src="https://cdn.hashnode.com/uploads/covers/6a1122211f237623ea5bd184/0a5facb6-16e4-4d31-9011-231b3206e290.png" alt="" style="display:block;margin:0 auto" />

<h3>Step 5: Request is Forwarded</h3>
<p>The Load Balancer forwards the request to the selected backend server.</p>
<img src="https://cdn.hashnode.com/uploads/covers/6a1122211f237623ea5bd184/4876dcf6-68db-47cc-a862-85356b00c55c.png" alt="" style="display:block;margin:0 auto" />

<h3>Step 6: Server Processes the Request</h3>
<p>The server:</p>
<p><strong>→</strong> Authenticates the user</p>
<p><strong>→</strong> Verifies subscription status</p>
<p><strong>→</strong> Retrieves stream information</p>
<p><strong>→</strong> Generates the response</p>
<img src="https://cdn.hashnode.com/uploads/covers/6a1122211f237623ea5bd184/5ea38675-2cfd-457e-9914-70de51c465f4.png" alt="" style="display:block;margin:0 auto" />

<h3>Step 7: Response Returns to User</h3>
<p>The processed response is sent back through the Load Balancer to the user.</p>
<img src="https://cdn.hashnode.com/uploads/covers/6a1122211f237623ea5bd184/21c9d0e0-ac93-473c-b756-1392cafb9d90.png" alt="" style="display:block;margin:0 auto" />

<h3>Step 8: Traffic is Distributed Continuously</h3>
<p>As millions of users join the IPL stream, requests are distributed among multiple servers.</p>
<img src="https://cdn.hashnode.com/uploads/covers/6a1122211f237623ea5bd184/dc244ba0-eaa6-43aa-ba48-817234b05fd8.png" alt="" style="display:block;margin:0 auto" />

<p>No single server becomes overloaded.</p>
<h3>Step 9: Server Failure Handling</h3>
<p>Suppose Server 2 crashes.</p>
<img src="https://cdn.hashnode.com/uploads/covers/6a1122211f237623ea5bd184/01db1d42-1491-4ce8-aa44-3ff916e6672c.png" alt="" style="display:block;margin:0 auto" />

<p>The Load Balancer detects the failure through health checks.</p>
<p>New traffic is automatically redirected to healthy servers.</p>
<p>Users usually don't notice the failure.</p>
<h3>Step 10: Smooth Streaming Experience</h3>
<p>Because traffic is distributed efficiently:</p>
<p><strong>→</strong> Servers remain healthy</p>
<p><strong>→</strong> Response times stay low</p>
<p><strong>→</strong> The platform remains available</p>
<p><strong>→</strong> Millions of users can watch IPL simultaneously</p>
<img src="https://cdn.hashnode.com/uploads/covers/6a1122211f237623ea5bd184/6e916ed1-6485-4855-bcd2-28e6a76308ce.png" alt="" style="display:block;margin:0 auto" />

<h1>Complete Work Flow</h1>
<img src="https://cdn.hashnode.com/uploads/covers/6a1122211f237623ea5bd184/c02fa742-872c-40d5-912d-08b9402efc3c.png" alt="" style="display:block;margin:0 auto" />

<h3>AWS Connection</h3>
<p>Elastic Load Balancer (ELB)</p>
<p>After understanding how Load Balancers work, a natural question is:</p>
<p><strong>How do companies implement load balancing in the cloud?</strong></p>
<p>AWS provides a managed service called Elastic Load Balancer (ELB) that automatically distributes incoming traffic across multiple targets such as EC2 instances, containers, and applications.</p>
<p>Instead of manually building and managing a Load Balancer, engineers can use <strong>AWS ELB</strong> to handle traffic distribution, health checks, and failover automatically.</p>
<p><strong>Key Features of AWS ELB</strong></p>
<p><strong>1) Traffic Distribution</strong></p>
<p>ELB automatically distributes incoming requests across multiple servers, preventing any single server from becoming overloaded.</p>
<p><strong>2) Health Checks</strong></p>
<p>ELB continuously monitors the health of backend servers. If a server becomes unhealthy, ELB automatically stops sending traffic to it and redirects requests to healthy servers.</p>
<p><strong>3) High Availability</strong></p>
<p>Traffic can be distributed across multiple Availability Zones, helping applications remain available even if one server or zone experiences issues.</p>
<p><strong>4) Seamless Scaling</strong></p>
<p>As traffic increases, new servers can be added behind the Load Balancer, allowing applications to handle growing demand efficiently.</p>
<p><strong>Types of Load Balancers in AWS</strong></p>
<p>To understand AWS load balancers properly, you first need to understand what <strong>Layer 4</strong> and <strong>Layer 7</strong> mean. These refer to layers in the <strong>OSI model</strong> — a framework that describes how data travels across a network.</p>
<p>Think of it this way — Layer 4 is like a postal service that reads only the address on the envelope to decide where to deliver it. Layer 7 is like a smart courier who actually opens the envelope, reads the contents, and then decides the best way to deliver it based on what's inside.</p>
<p><strong>Application Load Balancer (ALB) — Layer 7</strong> ALB operates at the <strong>application layer</strong>, meaning it can actually read the content of incoming HTTP/HTTPS requests — including URLs, headers, and cookies — before deciding where to route them. This makes it extremely powerful for <strong>web applications and APIs</strong> where different types of requests need to go to different backend services. For example, requests to <code>/video/stream</code> can be routed to one set of servers while requests to <code>/user/login</code> go to a completely different set.</p>
<p><strong>Network Load Balancer (NLB) — Layer 4</strong> NLB operates at the <strong>transport layer</strong>, meaning it routes traffic based purely on IP addresses and TCP/UDP ports without reading the actual content of the request. Because it doesn't inspect request content, it is significantly faster and can handle <strong>millions of requests per second with ultra-low latency</strong>. This makes it ideal for scenarios where raw performance matters more than intelligent routing ,such as handling the massive connection spike when millions of users simultaneously open a live IPL stream.</p>
<p>Large-scale streaming platforms often combine multiple layers of load balancing to achieve both high performance and intelligent request routing. NLB at the outer edge to absorb the massive volume of incoming connections, and ALB deeper in the architecture to intelligently route requests to the right backend services.</p>
<img src="https://cdn.hashnode.com/uploads/covers/6a1122211f237623ea5bd184/b7d98206-ba3e-4009-a25e-beca20fd8ed2.png" alt="" style="display:block;margin:0 auto" />

<p><strong>Key Takeaways</strong></p>
<ul>
<li><p>A <strong>Load Balancer</strong> distributes incoming traffic across multiple servers to prevent any single server from becoming overloaded.</p>
</li>
<li><p>Load balancing improves <strong>performance, availability, scalability, and reliability</strong>.</p>
</li>
<li><p>During live events such as IPL matches, millions of user requests can be handled efficiently through load balancing.</p>
</li>
<li><p>Modern Load Balancers continuously perform <strong>health checks</strong> and automatically redirect traffic away from failed servers.</p>
</li>
<li><p>AWS provides <strong>Elastic Load Balancer (ELB)</strong>, a managed service that helps organizations distribute traffic and maintain high availability.</p>
</li>
<li><p>Load Balancers are one of the fundamental building blocks behind large scale streaming platforms such as JioHotstar.</p>
</li>
</ul>
<h2>In the next part we will explore <em>How Auto Scaling Works?</em></h2>
<p><strong>References</strong></p>
<ol>
<li><p><a href="https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/introduction.html">AWS Elastic Load Balancing Documentation</a></p>
</li>
<li><p><a href="https://www.geeksforgeeks.org/system-design/what-is-load-balancer-system-design/">Geeks for Geeks - Load Balancing in Cloud Computing</a></p>
</li>
<li><p><a href="https://bytebytego.com/guides/what-is-a-load-balancer/">ByteByteGo Blog.</a></p>
</li>
<li><p><a href="https://www.loadbalancer.org/applications/streaming-media/">Load Balancer</a></p>
</li>
</ol>
]]></content:encoded></item></channel></rss>