Yushaku blog
  • Articles
  • Contact
  • About me

Load Balancer

system_design

Load balancing is a technique used to distribute network traffic across a pool of servers. It optimizes network performance, reliability and capacity, reducing latency as the demand is equally distributed among multiple servers and compute resources.

How Load Balancing Works

  • Load balancing sit between the servers and the internet.
  • handle incoming requests from users for information.
  • Once a request is received, the load balancer first determines which server in a pool is available and online and then routes the request to that server.
  • during times of heavy loads, a load balancer acts promptly and can dynamically add servers in response to spikes in traffic. conversely, load balancers can drop servers if demand is low.

Benefits

  1. Improved scalability.

    • Load balancers can scale the server infrastructure on demand, depending on the network requirements, without affecting services.
    • For example, if a website starts attracting a large number of visitors, it can cause a sudden spike in traffic. If the web server isn't able to manage this sudden influx of traffic, the website might crash. Load balancing can spread the extra traffic across multiple servers, preventing this from happening.
  2. Improved efficiency.

    • Due to the reduced burden of traffic on each server, the network traffic flows better and improves response times => This ultimately provides a better experience for site visitors.
  3. Reduced downtime.

    • Companies with a global presence and multiple locations in different time zones can benefit from load balancing, especially when it comes to server maintenance.
    • For example, a company can shut down the server that needs maintenance and route traffic to the other available load balancers without causing service interruptions or downtime.
  4. Predictive analysis

    • Load balancing can provide early detection of failures and help manage them without affecting other resources.
    • For example, software-based load balancers can predict traffic bottlenecks before they happen.
  5. Efficient failure management

    • In the event of a failure, load balancers can automatically redirect traffic to functional resources and backup options.
    • For example, if a failure is detected on a network resource, such as a mail server, load balancers can redistribute resources to other unaffected areas to prevent service disruption.
  6. Improved security

    • Load balancers add an extra layer of security without requiring additional changes or resources.

Algorithms

I found this blog explain the algorithms in a very detailed way: samwho/. i can't recommend it enough.