What is a load balancer and when does your website need one?
Published on 2026-10-20 by frfrand
Load balancer explicado con ejemplos: cómo distribuye solicitudes entre servidores, diferencia entre balanceo y failover, health checks y sesiones.

A load balancer is a component that receives connections or requests and distributes them among several servers capable of handling them. It is used to share workloads, keep services available, and avoid everything depending on a single application instance.
Imagine a restaurant with a single person taking orders. Even if there are ten cooks, if nobody distributes the tickets, service becomes chaotic. A load balancer plays a similar role: it decides where to send each new request.
How does a load balancer work?
Suppose you have three servers with the same application. Visitors enter tienda.ejemplo.com and arrive at a common point. That point knows the available instances and chooses which one to send each request or connection to.
The choice depends on the technology and the algorithm. For example, round robin distributes requests in rotation; least connections may prefer the server with fewer active connections.
This does not mean each visitor always ends up on the same server. The same person can make several requests and receive responses from different instances.
What is a health check?
A load balancer may need to know if an instance is actually ready to handle traffic. A health check is a health check: a request, connection, or other signal used to decide if a server remains available.
But checking that a port responds does not guarantee that the entire business works. An application can serve the homepage while its database is down. It is advisable to define checks that represent the actual capacity to process requests.
If an instance fails, the load balancer can stop sending traffic to it until it recovers, according to its rules.
Does load balancing mean high availability?
Not always. If you have three servers but a single load balancer without redundancy, that component can become a single point of failure.
There can also be a shared database that, if it goes down, renders all instances unusable. Distributing requests is only part of availability.
Failover means switching to an alternative when a component fails. Load balancing means distributing traffic among available options. They can work together, but they are different concepts.
What about user sessions?
Imagine that a client logs in to server A and their next request arrives at server B. If the session state exists only in the memory of the first one, the second may not know about it.
That is why distributed applications usually use shared sessions, tokens with proper validation, or other architectures that allow handling requests from multiple instances.
Some load balancers offer affinity or sticky sessions, but that does not replace state planning. If the chosen server stops working, you still need a strategy.
What is the difference between L4 and L7 load balancing?
A layer 4 load balancer works mainly with transport data, such as TCP or UDP connections and addresses/ports.
A layer 7 load balancer can interpret application-level requests, such as HTTP, and make decisions based on routes, headers, or hostnames.
It is not that layer 7 is universally better. It allows more specific decisions, but it implies other considerations regarding complexity, performance, and encryption handling.
Do I need one for my first website?
Probably not. A small application can work perfectly on a single VPS. Introducing a load balancer, duplicate servers, and a shared database means more work, more components, and more possible points of failure.
It may start to make sense when you really need additional capacity, zero-downtime updates, or instance fault tolerance. First measure traffic, resources, and response times.
What about Nginx?
Nginx can act as a web server and as a connection or request load balancer, depending on how it is configured. It can distribute traffic among multiple backends and apply different policies.
That does not mean that Nginx automatically makes copies of the application or keeps databases synchronized. The load balancer only knows the alternatives you configured and the corresponding rules.
Where does ArduMaker come in?
In an infrastructure with multiple VPS managed from ArduMaker, a load balancer can act as an entry point to the applications. You must define which destinations receive traffic, how to detect failures, and what happens if the load balancer itself becomes inaccessible.
In summary: a load balancer distributes requests; a highly available architecture must also resolve sessions, data, monitoring, and single points of failure.
Sources: HTTP load balancing in Nginx · Nginx: methods and configuration.
