How Load Balancing Keeps Apps From Crashing Under Traffic

What really happens when IRCTC or a sale site crashes under traffic, and how load balancing, failover, and scaling keep apps running instead.

Nov 21, 2026 - 12:08
5 min read
 0
How Load Balancing Keeps Apps From Crashing Under Traffic

10:00 AM, Tatkal booking opens, and the IRCTC app freezes mid-tap. Somewhere a few hundred kilometres away, the same thing is happening to a few hundred thousand other people at the exact same second. The app didn't break because the code is bad. It broke because every one of those requests tried to land on the same door at once. The fix for that problem has a name: load balancing, and it's one of the quieter pieces of engineering that decides whether an app survives its busiest moment or falls over.

What actually happens when you tap "book now"

Every time you open an app or load a website, your phone sends a request out to a server — a computer, usually sitting in a data centre, whose job is to receive that request, do some work (check a seat, process a payment, fetch a feed), and send a response back. One server can comfortably handle a request every few milliseconds. The trouble starts when thousands of requests arrive in the same instant. A single machine, however powerful, has a ceiling: a limited number of processor cores, a limited amount of memory, a limited number of connections it can hold open. Past that ceiling, requests start queuing, then timing out, then failing outright. That's the blank screen or the "please try again later" message.

Spreading the crowd across many doors

A load balancer sits in front of a group of servers and does one job: decide which server gets each incoming request, so no single machine gets overwhelmed while others sit idle. Instead of one door, there might be fifty identical doors, and the load balancer is the person directing the queue.

It does this using a handful of fairly simple strategies:

  • Round robin — requests are handed out to each server in turn, like dealing cards.
  • Least connections — new requests go to whichever server is currently handling the fewest active ones.
  • Health checks — the load balancer constantly pings each server to confirm it's still responding; a server that stops replying gets quietly removed from the rotation until it recovers.

That last part matters as much as the distribution itself. If one server in the group crashes, the load balancer simply stops sending it traffic and reroutes everything to the ones still standing — what engineers call failover. Users never see the individual failure; they just keep getting served. Adding more servers to handle growth is called horizontal scaling, and it's generally cheaper and more resilient than the alternative, vertical scaling, which just means buying one bigger, more expensive machine that still has a single point of failure.

A load balancer doesn't make an app faster. It makes an app survive being popular.

Why things still go wrong during a rush

Load balancing solves the "which server" problem, but it doesn't solve every bottleneck. A classic failure pattern — sometimes called a thundering herd — happens when millions of users are told, explicitly, to act at the same second: a Tatkal window opening, an exam result going live, a flash sale starting at midnight. Even with traffic perfectly spread across a hundred servers, if every one of those servers needs to check the same database record (the same train, the same bank account, the same stock number), the database itself becomes the new chokepoint. This is exactly why IRCTC's Tatkal system, UPI rails during big festive sales, and ticketing platforms during concert drops still stumble occasionally even though the companies running them know the spike is coming months in advance. Spreading web traffic is the easy half of the problem; spreading writes to a shared piece of data safely is the much harder half.

It's also why a lot of these same platforms lean on a CDN alongside load balancing — a CDN handles the static, repeatable stuff (images, app assets, pages that look the same for everyone) from servers close to the user, so the load balancer and the main servers only have to deal with the requests that genuinely need fresh data.

Why this matters beyond the engineers

For Indian developers and startups, this isn't an abstract systems-design topic. India produces some of the most extreme, predictable traffic spikes anywhere: a cricket match's last over on Hotstar, a Big Billion Days sale at midnight, a board exam result at 11 AM, a UPI corridor on Diwali. Building for the Indian market means building for genuine, scheduled cliffs in demand rather than gradual growth curves, and that changes how teams plan capacity — often provisioning extra servers for a known two-hour window rather than running them year-round, since cloud providers let you scale up and back down on demand.

None of this requires users to understand round robin or health checks. But the next time an app you're using holds up gracefully during a sale while another one buckles, the difference usually isn't better code — it's a team that planned for the crowd before the crowd showed up.

Short URL: https://code24.in/caff841e

What's Your Reaction?

Like Like 0
Dislike Dislike 0
Love Love 0
Funny Funny 0
Angry Angry 0
Sad Sad 0
Wow Wow 0
Ashif Sadique As an full-stack developer, I'm passionate about sharing tutorials and tips that aid other programmers. With expertise in PHP, Python, Laravel, Angular, Vue, Node, Javascript, JQuery, MySql, Codeigniter, and Bootstrap. To me, consistency and hard work are the keys to success.