load balancing

traffic guard

When your traffic grows, it’s common to take the horizontal scaling strategy, but with many servers running your business, how to distribute the incoming load? that’s when load balancers come in handy.

A load balancer it’s a piece of the system design that’s responsible for directing tasks between computational resources, just like the image below:

load balancing 2023-10-18 23 01 16 excalidraw

The new load will first hit the load balancer, which will choose a processing unit to forward it, many different algorithms can be used by a load balancer to determine which processing unit will receive the next load, these are the most common algorithms:

  • round robin
  • weighted round robin
  • least connections
  • resourced based
edit on github