Follow

Follow
Load Balancing | A Necessity to Learn | Introduction

Load Balancing | A Necessity to Learn | Introduction

๐ŸŽฏ It is necessary to learn Load Balancing if you are a Developer

Lovepreet Singh's photo
Lovepreet Singh
ยทDec 9, 2022ยท

2 min read

Play this article

๐Ÿ“ Microservices

๐Ÿ‘‰ When writing the backend code, A developer should always think about how to design and structure the code. Forex. Before writing the server code involving multiple services like ordering food, giving feedback, and creating a user account. All these services mentioned before are independent (kind of) from each other. So, why keep them all in a single codebase?

The False Promise of Microservices | by Mika Yeap | CodeX | Medium

๐Ÿ™‚ We can separate the logic of creating, replacing, deleting, and updating the user from ordering a food item. So, we can make different services and can scale them independently. There are some tools like Docker, Kubernetes, etc to containerize and manage the containers respectively. But sometimes these servers get a lot of concurrent requests and might not serve all the clients in a small time. That is where we do replicate our servers (having different services) and distribute the traffic in different servers.

๐Ÿ“ Load Balancing Introduction

Well, when we request the server then we are not the only ones making a request. There are thousands or millions (Possibly) of concurrent users who can request the server at the same time. So, we must balance the incoming load or distribute the load.

load balancing diagram

๐Ÿ‘‰ A load balancer does these things in general:-

  • Distributes the client's requests or network load to the different servers

  • Ensures high availability and reliability

  • Keeps the servers that are online and provides flexibility

๐Ÿ™‚ There are some Algorithms to balance the load like Round Robin, Least connections, Hashing, and Random Selection.

๐Ÿ”ฅ Note:- Follow RealCS for more.

There are different types of load balancing though like DNS, Cloud, Global server, Hybrid, Layer 4, and Layer 7 load balancing. Two main load balancers are Layer 4 and 7 (Layers concerning the OSI model).

Load balancing can be done using:-

  • Balancing using DNS (Fails when a server gets down)

  • Balancing through Hardware (Most expensive way)

  • Balancing through Software (Reliable method)

Hardware load balancers are layers of 4-7 routers that are capable of handling all kinds of HTTP, HTTPS, TCP, and UDP traffic. Some of the popular software load balancers are:-

  1. Nginx

  2. Avi Vantage Software Load Balancer

  3. HAProxy

  4. Kemp LoadMaster

  5. Loadbalancer.org

  6. ManageEngine OpManager

  7. Citrix ADC

  8. Barracuda Load Balancer ADC

  9. Incapsula

  10. Total Uptime Cloud Load Balancer

  11. jetNEXUS Load Balancers


Follow ๐Ÿคœ Load Balancing using Nginx with in-depth implementation steps