← All topics

What is a load balancer?

When tickets go on sale, many people may open the shop at once. A load balancer can share those requests among several running instances, provided the application is prepared for it.

One address, several instances

A load balancer accepts requests and forwards them to instances of an application according to configured rules. It might send requests to each instance in turn. The traffic the system can handle still depends on its resources and shared services such as the database.

A reverse proxy also sits in front of an application. Even with one instance, it can route requests by domain to the right service and accept HTTPS connections. Distributing traffic among several instances of the same application shares its load. One piece of software can perform both jobs.

Keep unhealthy instances out of rotation

Configured health checks let the balancer regularly test which instances respond. When it detects an unhealthy instance, it can stop sending requests there. This does not prevent every failed request or preserve a connection that was already in progress.

The remaining instances need spare capacity to absorb additional traffic. If they all run on one server, losing that server still affects them all. The shared entry point also needs a place in your availability plan.

Keep the basket available across requests

If the ticket shop stores a session only in one instance’s memory, the second instance may not recognise the signed in visitor. Shared session storage and keeping a visitor assigned to one instance are different approaches. Assigning a visitor to one instance alone does not preserve their session if that instance fails.

Reservations also need shared storage with suitable controls for simultaneous bookings. A balancer does not prevent seats from being sold twice or start additional instances by itself.

Traefik in the MainPath architecture

MainPath sets up Traefik as a reverse proxy on classic servers. The architecture documentation describes routing requests by domain to the right container and setting up HTTPS.

That documented routing does not establish how traffic is distributed among several instances of one application. Such a setup needs appropriate instances, routing rules, and health checks. Having a proxy does not imply automatic scaling or guaranteed availability.

Thank you for your request

We have received your request and will get back to you as soon as possible.

Would you like to talk to us directly?

Choose a time here for an introductory call with Robin.

Open the calendar in a new tab