0
0
HLDsystem_design~12 mins

Load balancing algorithms (round robin, least connections) in HLD - Architecture Diagram

Choose your learning style9 modes available
System Overview - Load balancing algorithms (round robin, least connections)

This system demonstrates how load balancers distribute incoming user requests to multiple backend servers using two common algorithms: round robin and least connections. The goal is to efficiently balance traffic to ensure no single server is overwhelmed, improving response times and reliability.

Architecture Diagram
User
  |
  v
Load Balancer (Round Robin / Least Connections)
  |
  +-------------------+-------------------+-------------------+
  |                   |                   |
Server 1           Server 2           Server 3
  |                   |                   |
Database            Database            Database
  
Components
User
client
Sends requests to the system
Load Balancer
load_balancer
Distributes incoming requests to backend servers using round robin or least connections algorithm
Server 1
service
Processes requests and queries the database
Server 2
service
Processes requests and queries the database
Server 3
service
Processes requests and queries the database
Database
database
Stores persistent data accessed by servers
Request Flow - 6 Hops
UserLoad Balancer
Load BalancerServer (selected by algorithm)
ServerDatabase
DatabaseServer
ServerLoad Balancer
Load BalancerUser
Failure Scenario
Component Fails:Load Balancer
Impact:All incoming user requests fail to reach backend servers, causing complete service outage.
Mitigation:Deploy multiple load balancers with health checks and failover to ensure high availability.
Architecture Quiz - 3 Questions
Test your understanding
Which load balancing algorithm sends requests to servers in a fixed order, cycling through each one?
ARound Robin
BLeast Connections
CRandom Selection
DIP Hash
Design Principle
This architecture shows how load balancers use algorithms like round robin and least connections to distribute traffic evenly and efficiently among servers, preventing overload and improving system reliability.