Load Balancing !!

Shanira Perera
2 min readAug 24, 2022

How to balance the load as a Software Engineer

Hi all, Welcome to another Techi Talk,

Why We Need Load Balancing

Lets start from what is load balancing… its simply balance the load, ok don’t be confused lets go through briefly to identified it.

I take a simple example as User service this service can handle 100TPS

TPS → Transaction Per Second

Somehow on a situation it hit with 500 tps, now its a problem the user service getting overload now. so there was a two options we can do

  1. Scale Up
  2. Scale Out / Scale wide / Horizontally Scaling

Scale Up is increase memory, increase processor, increase bandwidth … etc. but it has limitations, and scale out means adding more servers.

Take previous example it has 500 tps but we have a 100tps service handler then what the solution is adding more 4 services of 100 now it can handle 500 tps with 5 services. is problem solved? it seems like yes but actually it not!!!

OK now what we do is we add Reverse Proxy to between user and server.

Randomly Distribution Load Balancing

Now talk about how to distribute the traffic to server 1st method is randomly it means revers proxy randomly put the traffic to servers think if it send traffic to same server that means some sort of servers are overloaded and some are not get even one traffic. therefore randomly distribute method is not a option for this.

Round Robbin Load Balancing

Round robin is what is means it distribute the traffic sequentially that means one after one and loop it.

Weighted Round Robbin Load Balancing

There is another thing in that sequence, Some reason there was a high performance server. It will treat specially that means it gives more traffic to that server.

GEO Weight Load Balancing

This means some solution implement for the global it means it has servers in Asia, Europe, US some one in sri lanka need to access the server he go to the Asia server if some one in German he go the Europe server like wise.

Hash IP Load Balancing

This works like this you hash the source IP address first and the based on the hash value you can decide which server to reach this was not act as the GEO because you don’t really see the other origination territories.

Mixing Method

Image by Author

In this method you can see when client request directed to the Geo based load balancer it will distribute the load to the other load balancers which areb specific as regional based. then it will re distribute the traffic to the servers. we can use multiple load balances in between.

Thanks~!!

Hope You Learn Something !!! Keep Follow for more Interesting Stuffs See You Soon!!! 😉

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Shanira Perera
Shanira Perera

Written by Shanira Perera

Hello, I’m Shanira, welcome to the world of technology. I am an Associate software engineer at virtusa. So let’s begin!

No responses yet

Write a response