What is Load Balancer?
How It Works, Types and Algorithms

A load balancer is a service or device that shares incoming user requests across several servers, so no single server gets overloaded. It checks which servers are healthy and sends each visitor to one that can answer. If a server fails, it moves visitors to the others, so the site keeps working.

Short Answer A load balancer is a service or device that shares website visits across servers, so none gets overloaded. Picture shoppers sent to open counters.

What is a Load Balancer?

Every website or app runs on servers. A server is a computer that answers requests, such as “show me this product page”. When only a few people visit, one server can cope. But when thousands arrive at once, a single server slows down or stops.

A load balancer sits in front of a group of servers and shares out the work, a job called load balancing. Users see one web address. Behind it, the load balancer passes each request to one of many servers. As a result, nobody waits in a long queue.

Think of a busy supermarket. If one billing counter closes, the manager sends shoppers to the next open one. A load balancer does the same for web traffic.

Key Words to Know

  • Traffic: the requests users send to an app, such as page visits, logins and payments.
  • Health check: a repeated test that shows whether each server still works.
  • Target group: AWS’s name for the list of servers (targets) that a load balancer sends traffic to.
  • Failover: moving traffic away from a failed server to working ones.
  • Availability zone: a separate building or group of buildings full of servers, with its own power and network. Several zones sit in one cloud region, an area such as Mumbai.

How Does a Load Balancer Work?

A load balancer follows the same simple loop for every request.

  1. A request arrives: a user opens the app. Their browser looks up the app’s address through DNS, the internet’s phone book, and that address points to the load balancer.
  2. It checks its list: the load balancer already knows which servers are healthy, because it tests them again and again at set intervals.
  3. A rule picks a server: this rule, called an algorithm, chooses one healthy server.
  4. It passes the request on: the chosen server does the work, such as loading the product page.
  5. The answer goes back: the user gets the page and never sees which server answered.
  6. It handles failure: if a server stops answering health checks, the load balancer stops sending it traffic. Once the server recovers, it gets traffic again.
A user request goes through DNS to a traffic manager that sends it only to servers passing health checks
The load balancer keeps testing every server and sends users only to the ones that pass.

So one broken server does not take the whole app down. AWS Elastic Load Balancing, for example, sends traffic only to healthy targets.

An Example From a Festive Sale

For example, an online clothing shop in Jaipur runs its website on three servers. During the Diwali sale, visits jump many times over by evening. So the load balancer shares those visits across all three servers. Next, the team adds two more servers for the sale week. The load balancer starts using them as soon as they pass their health checks. Then, midway through the sale, one server crashes. Most shoppers do not notice, because the load balancer quickly moves new visits to the other four.

What Are the Types of Load Balancers?

You can group load balancers in three ways. First, by how much of each visit they look at (Layer 4 or Layer 7). Second, by what they run on (hardware, software or cloud). Third, by how far they reach (one region or many).

Layer 4 and Layer 7 Explained

Network experts describe traffic in layers, from cables at the bottom to apps at the top.

  • Layer 4 (network level): the load balancer looks only at where the request comes from and where it goes. It is like a postman who reads the envelope but not the letter. So it is very fast and works for almost any traffic, such as video calls or game traffic.
  • Layer 7 (application level): the load balancer reads the request itself, such as the web page path. For example, it can send “/payments” to payment servers and “/images” to image servers.

Hardware, Software and Cloud Options

  • Hardware: a physical box in a company’s own data center. It is fast but fixed in size, and the IT team must buy, install and maintain it.
  • Software: a program that runs on an ordinary server or virtual machine, a software computer on shared hardware. It is more flexible, and the team can add another copy quickly.
  • Cloud: a managed service from a cloud provider. It is quick to set up, grows with your traffic, and the provider looks after the machines.

Global and Regional Load Balancers

A regional load balancer shares traffic among servers in one cloud region. In contrast, a global one shares traffic across several regions. So users in Delhi and London each reach the nearest healthy copy of the app. Also, if a whole region has trouble, it can send everyone to another region.

Type What It Means Best For
Layer 4 Reads only where traffic comes from and goes Very fast traffic of any kind
Layer 7 Reads the web request, such as the page path Websites, apps and APIs
Cloud A managed service that grows with traffic Apps that run in the cloud
Global Shares traffic across regions Users in many cities or countries

Load Balancer Algorithms

An algorithm is simply the rule a load balancer uses to choose the next server. Some rules are fixed in advance, such as round robin, weighted and IP hash. Others, such as least connections, first check how busy each server is.

  • Round robin: servers take turns, one after another, like dealing cards. It works well when all servers are the same size.
  • Least connections: the next request goes to the server with the fewest active users right now. It helps when some requests take much longer than others.
  • Weighted: bigger servers get a bigger share. For example, a server twice as large gets about twice the requests.
  • IP hash: the load balancer uses the user’s internet address to pick a server. As a result, the same user usually lands on the same server.

For example, in AWS the Application Load Balancer uses round robin by default. It also offers “least outstanding requests”, which picks the server with the fewest unfinished requests. Another option, “weighted random”, picks at random but gives some servers a bigger share. In addition, many support sticky sessions, which keep one user on one server for a while, so a shopping cart stays in place.

Talk to an ExpertIs your app ready for its busiest day? Talk to our team about load balancing.

Load Balancer in Cloud Computing: AWS and Azure

In cloud computing, you rarely build a load balancer yourself. Instead, you switch one on as a managed service. It works with auto scaling, which adds or removes servers on its own as demand changes.

AWS Elastic Load Balancing

Elastic Load Balancing is the AWS family of load balancers. It spreads traffic across targets in one or more availability zones. Targets can be servers, containers (small packaged pieces of software) or any machine reached by its internet address. It has three current types:

  • Application Load Balancer: works at Layer 7 for websites and apps. It can route by web page path, and it needs at least two availability zones.
  • Network Load Balancer: works at Layer 4 for very fast traffic of almost any kind. It also gets a fixed network address (IP address) in each availability zone.
  • Gateway Load Balancer: sends traffic through security tools first, such as virtual firewalls and systems that spot and block attacks. They check it before it reaches your servers.

AWS also has an older Classic Load Balancer and recommends moving to one of the three current types.

Azure Load Balancing Services

Microsoft offers several options, including these three:

  • Azure Load Balancer: a Layer 4 service that spreads network traffic across virtual machines. It can face the internet (public) or serve only a private network (internal). Microsoft retired its older Basic version on 30 September 2025, so new setups use the Standard version.
  • Azure Application Gateway: a Layer 7 web traffic load balancer for one region. It can route by web page path and can include a firewall for web traffic.
  • Azure Front Door: a global Layer 7 service that also works as a content delivery network (CDN). A CDN is a set of servers around the world that bring content closer to users.

Many real setups combine two services. For example, Azure Front Door sends each user to the nearest region. Then Application Gateway shares visits among the servers there.

Traffic from users spread across servers in two separate data center zones, with extra servers added at peak times
Spreading servers across two zones means the app keeps running even if one zone has a problem.

Load Balancer vs API Gateway

People often mix up three tools that sit in front of servers. A reverse proxy is a server that takes requests for other servers and passes them on. An API gateway is the front door for APIs, the connections that let apps talk to each other. It checks who is calling, limits how often they call and tracks use. It is also a core part of API management.

Question Load Balancer API Gateway Reverse Proxy
Main job Share traffic across servers Control and secure API calls Stand in front of servers and pass requests on
Works at Layer 4 or Layer 7 Layer 7 Mostly Layer 7
Typical extras Health checks, failover Sign-in checks, call limits, usage reports Keeping copies of pages to serve them faster, hiding server details
Example Sharing shop visits across five servers Letting a partner app check stock One web address for several behind-the-scenes apps

In practice, the three often overlap. A Layer 7 load balancer is a kind of reverse proxy, and an API gateway often shares load too. For instance, Microsoft notes that Azure API Management can share traffic across the servers behind an API. However, its main purpose is gateway work. So pick each tool for the job it does best.

Why Does a Load Balancer Matter for a Business?

For a business, a load balancer helps keep the website open for customers.

  • Uptime: if one server fails, the app keeps running on the others. This is called high availability.
  • Traffic spikes: during festive sales, exam results or salary-day logins, visits are shared across all servers. So the site is far less likely to slow down or crash, if enough servers sit behind it.
  • Easy growth (scalability): you add servers behind the load balancer instead of buying one giant server. Experts call this scaling out.
  • Safe updates: the team can take one server out, update it and put it back, while users keep working on the rest.

A load balancer also supports good security. Many teams place a web application firewall in front of it to block harmful requests. In addition, spreading traffic across many servers and zones helps an app keep working during a DDoS attack. That is a flood of fake traffic meant to knock a site offline. However, a load balancer alone cannot stop a large attack, so AWS and Microsoft also offer separate DDoS protection services.

Also, load balancers are a basic building block of cloud native apps, which run as many small, replaceable parts.

Does Your Business Need One?

If your shop runs on a hosted online store platform, the platform usually runs load balancers for you. You need your own when your team runs the site on its own servers or cloud account, and one server cannot cope.

Frequently Asked Questions About Load Balancer

What is a load balancer in networking?

In networking, a load balancer is a device or service that shares network traffic across several servers. It keeps checking which servers are healthy and sends each new connection to one that can take it. As a result, no single machine gets overloaded. The network service also keeps working when one server goes down, because traffic simply moves to the others.

What is a load balancer in system design?

In system design, a load balancer is the part that sits between users and a group of matching servers. Designers add it so the system can grow by adding servers, survive a server failure and spread work evenly. In most design diagrams, it appears near the front, right after DNS and before the web servers that run the app.

What is a load balancer in Kubernetes?

Kubernetes is an open source system that runs apps in containers, which are small packaged pieces of software. Inside it, a “Service” shares traffic across the copies of an app. To reach outside users, a Service of type LoadBalancer asks the cloud, such as AWS or Azure, for a real cloud load balancer address. Traffic to that address then goes to those copies.

What is a load balancer in microservices?

Microservices split one big app into many small services, such as login, cart and payment. Each small service often runs several copies. A load balancer shares calls among those copies, so one busy or broken copy does not slow down the whole app. Many setups use one load balancer at the front door and smaller ones between the services inside.

What is a load balancer in cyber security?

In cyber security, a load balancer helps keep an app available, and availability is one part of security. It can hide the real server addresses and handle secure HTTPS connections, the padlock in the browser, in one place. It can also work with a firewall for web traffic and help absorb sudden traffic floods. However, it is not a firewall itself, so teams still need proper security tools.

Is a load balancer the same as a router?

No. A router connects networks and picks the path that data takes, for example from your office to the internet. A load balancer sits in front of servers and picks which server answers each request. Some office routers can share internet traffic across two internet lines, and router makers call that load balancing too. Still, it is a different job.

Is load balancing done by a device or a service?

It can be either. A hardware load balancer is a physical box in a data center, and a software one is a program on a normal server. Today, however, many companies use a cloud service instead, such as AWS Elastic Load Balancing or Azure Load Balancer. The cloud provider runs the machines, and your team only sets the rules.
Use CaseDesign Scalable and Resilient Cloud Architecture

References

  1. How Elastic Load Balancing works: AWS, How Elastic Load Balancing works
  2. Azure load balancing services: Microsoft Learn, Load balancing options
  3. Azure Load Balancer: Microsoft Learn, What is Azure Load Balancer?
Stay Updated

Get the Latest Terms & Insights.

New encyclopedia terms, threat intelligence, and architecture decisions, by email.

Book a Consultation

A practice principal will contact you within 1 business day.

Thank you! A Signisys principal will be in touch within 1 business day.