Load Balancing Explained
Load balancers are an important part in system design. A deep dive into the essentials of load balancing
#1 What Is Load Balancing ?
> Load balancing is the practice of distributing computational workloads between two or more computers
> It is done to introduce resilience, improve application availability & divide the load onto multiple machines
> Load balancing can be done at OSI layer 4 or OSI layer 7 depending on the design of the application
> Layer 4 load balancers route traffic based in IP & Ports
> Layer 7 load balancers allow much more control over routing using protocol, URLs, etc
#2 Static vs Dynamic Load Balancing ?
> Static load balancing works on a preconfigured setting & is ideal for scenarios where traffic spike is not expected.
> Round robin, weighted round robin & IP Hashes are popular static load balancing algorithms
> Dynamic load balancing algorithms take the current availability, workload, and health of each server into account. They can shift traffic from overburdened or poorly performing servers to underutilized servers, keeping the distribution even and efficient
> Least connection, weighted least connection, weighted response time, resource-based are some popular dynamic load balancing algorithms
Layer 4 (IP & Port based load balancing)
> Load balancer gets created with a IP/DNS & Port & is tagged to a backend IP pool of VMs running a specific service on a specific port
> The job of the LB is to take in requests on a specific port & forward it to one of the available backend hosts
> The LB can be configured to run periodic health checks to ensure backend hosts are healthy & application availability is maintained
Layer 7 (application level load balancing)
> End user requests connection to a specific URL
> The LB decrypts the request, analyzes the requested service & routes it to the backend machine running that service
> Layer 7 load balancing offers additional advantages such as SSL termination, caching, pre-processing etc.
Follow Me If You Like 🐍 Python 🤖 Machine Learning/AI ⚙️ Software Engineering 📊 Data Visualization 📩 DM For Collab youtube.com/@jaydeepkarale







Load Balancers are a critical piece of modern architecture!
Thanks for the article, Jaydeep.