DEV Community

Cover image for What is a load balancer?
Abdirizak Obsiye
Abdirizak Obsiye

Posted on

What is a load balancer?

Thank you for clicking on this! 🙌
I will give you a brief answer! 🙇‍♂️


TLDR; "In computing, load balancing refers to the process of distributing a set of tasks over a set of resources"

Here's a short video I created


Introduction:

A load balancer is a software or a physical device that shares out the workload across servers/resources. It sits between the front-end and back-end (server-side load balancers). Any requests to the back-end will go through the load balancer, which will decide what server to send it to. The load balancer may ask questions like: is server-1 running? If not, send it to server-2 or which server is the fastest for computing calculations? etc.

Examples of load balancers include:
• Nginx
• AWS Elastic Load Balancing

What does it prevent?

A single point of failure. Instead of all the requests going to one server, it can be redirected and distributed effectively.

Alt Text

Do not get me wrong, the load balancer is smart. By doing all sorts of algorithmic and factor-driven decisions it can provide a greater and less strained application experience. It can work for sessions management, security management (firewalls), performance and so on.

Alt Text

For Application HTTP request management:

• Server-side load balancers (between the frontend and backend)
• Persistence (sessions management)
• Priority activation (Number of available servers not enough then it can start standby servers)

Example scenario:

User: Hey Dexxter (load balancer)! I need this book called “How to make How-tos”

Load balancer: Hmm, I see server 2 and server 1 have too much to do. Also, the number of available servers has dropped below 1 (no more available) or (drops below a certain number), There’s server 3 on standby so I’ll wake it up and tell it to handle/do that request for you. << That is Priority activation.

Load balancer: I used Asymmetric load where a “ratio can be manually assigned to cause some backend servers to get a greater share of the workload than others” I happened to give server 2 more work than server 1 to make better use of the backend resources. This will give a faster user experience.

User: That ebook loaded really quickly. I wonder what they did differently on this site.

cough cough they used a load balancer!

Features of server-side load balancers:

Asymmetric load "A ratio can be manually assigned to cause some backend servers to get a greater share of the workload than others."

Priority activation "When the number of available servers drops below a certain number, or load gets too high, standby servers can be brought online."

Conclusion:

A load balancer is a magnificent🙏🏻, powerful 💪, way of distributing the workload in the back-end. Thank you for reading this far! 😃

Please find more information on Wikipedia

In computing, load balancing refers to the process of distributing a set of tasks over a set of resources, with the aim of making their overall processing more efficient. Load balancing techniques can optimize the response time for each task, avoiding unevenly overloading compute nodes while other compute nodes are left idle.

Top comments (1)

Collapse
 
kiranroyal1 profile image
kiranroyal1

This Serves as good introduction to load balancers