WEBVTT

00:00.140 --> 00:00.680
Hey, everyone.

00:00.680 --> 00:01.690
And welcome back.

00:01.700 --> 00:06.940
Now, in today's video, we will be discussing about a very important topic of load balancers.

00:06.950 --> 00:12.740
In fact, in most of the organizations that you will see, Load Balancer is one of the key technology

00:12.740 --> 00:15.590
that is implemented across all of them.

00:15.590 --> 00:19.700
So let's go ahead and understand the basics of load balancers.

00:19.700 --> 00:25.040
Now, before we discuss about Load Balancer, let's look into a typical challenge that organizations

00:25.040 --> 00:27.860
used to face before this technology was introduced.

00:27.860 --> 00:34.100
So let's assume that you have a single server and organization has installed a application on this server,

00:34.100 --> 00:37.970
and this server itself is serving all of the production traffic.

00:38.120 --> 00:45.830
Now due to some reason, if this single server goes down, then the entire production traffic is affected.

00:45.830 --> 00:48.770
Now a server can go down due to any number of reasons.

00:48.770 --> 00:52.340
Maybe application is not working, maybe the kernel is not working.

00:52.340 --> 00:54.560
Maybe there is some issue related to hardware.

00:54.560 --> 00:59.300
Maybe there is some issue related to the internet that is connected to the server and so on.

00:59.300 --> 01:05.730
So the aim is that a single server going down should not really affect the production traffic.

01:05.730 --> 01:10.770
And in order to overcome this you have a recommended way of using a load balancer.

01:10.770 --> 01:15.180
So what happens is this revised approach is you create multiple servers.

01:15.180 --> 01:21.000
So now you have two servers and on top of that you make use of a load balancer.

01:21.000 --> 01:26.940
So load balancer is an additional component and this load balancer will distribute the traffic across

01:26.940 --> 01:27.930
both of the server.

01:27.930 --> 01:33.570
So now what will happen is any client who is visiting the website, the request will first go to the

01:33.570 --> 01:34.530
load balancer.

01:34.560 --> 01:40.740
Load Balancer will go ahead and distribute the request depending upon various algorithm that is been

01:40.740 --> 01:41.700
configured here.

01:41.700 --> 01:47.460
In a simplistic term, the request is distributed 5,050%, so first request will go to server one,

01:47.460 --> 01:49.710
second request will go to server two and so on.

01:49.710 --> 01:52.950
So this is a very high level overview about load Balancer.

01:52.950 --> 01:57.060
Now let's go ahead and quickly look into it at a demo perspective.

01:57.060 --> 02:02.720
So for today's demo, very similar to the diagram that we were discussing, we have two servers, we

02:02.720 --> 02:08.150
have server one, server two, and we have a new component of load balancer that is introduced.

02:08.180 --> 02:15.290
Now this load balancer again is basically a server with a software that can do a load balancing across

02:15.290 --> 02:17.120
both of the servers here.

02:17.120 --> 02:23.420
So now when a client wants to open a website, he will not really open up the server one or a server

02:23.420 --> 02:23.750
to.

02:23.780 --> 02:27.160
He'll basically the request will go to the load balancer IP.

02:27.410 --> 02:33.890
So in this case, all of the server has their individual IPS, but the client will basically open up

02:33.890 --> 02:36.050
the load balancer IP over here.

02:36.320 --> 02:41.960
Now before we go ahead and make a request to the load balancer IP, let's quickly open up the IP of

02:41.960 --> 02:43.040
server one, Server two.

02:43.040 --> 02:45.500
Let's look into what exactly is being loaded here.

02:45.500 --> 02:51.440
So for server one, I'll add the IP here and the response is very straightforward.

02:51.440 --> 02:53.270
It states this is server one.

02:53.270 --> 02:58.400
Similarly, let's open up the server two IP here, I'll paste it here.

02:58.400 --> 03:01.350
And again, the response is very straightforward.

03:01.350 --> 03:04.800
This is server two, so very straightforward response here.

03:04.800 --> 03:08.340
Now let's go ahead and make a request to the load balancer here.

03:08.340 --> 03:12.270
So from a new tab, I'll make a request to the load balancer IP.

03:12.540 --> 03:15.390
This time you see, the request went to the server one.

03:15.390 --> 03:18.090
So first request that we made to the load balancer.

03:18.090 --> 03:19.680
IP went to server one.

03:19.680 --> 03:21.660
Let's make a request again.

03:23.710 --> 03:26.770
And this time you see the request went to server two.

03:27.250 --> 03:28.750
Let's refresh.

03:28.780 --> 03:31.330
You see requests again went to server one.

03:31.930 --> 03:34.750
We'll refresh request again, went to server two.

03:34.780 --> 03:38.080
So this is what the load balancer is all about.

03:38.110 --> 03:44.830
Now one important part to remember is that in this specific demo I have used a specific server where

03:44.830 --> 03:47.140
a load balancer based software is installed.

03:47.170 --> 03:53.430
Now, if this load balancer server goes down, then again your entire application also goes down.

03:53.440 --> 03:59.920
So it is very important that whatever technology that you use at a load balancer level, you have to

03:59.920 --> 04:01.970
ensure that this is highly available.

04:01.990 --> 04:07.630
Now, depending upon various cloud provider that you might use, maybe Azure, et cetera, they have

04:07.630 --> 04:13.210
a highly available load balancing solution that is already available, so you do not really need to

04:13.210 --> 04:16.000
worry that the load balancer itself will go down.

04:16.030 --> 04:18.730
This is something that you do not need to worry.

04:18.760 --> 04:22.130
All you have to worry is about your applications itself.

04:22.150 --> 04:28.100
However, if you are hosting your own load balancing based solution in a virtual machine or in a server,

04:28.130 --> 04:33.260
then the high availability part of load balancer again goes into your responsibility.

04:33.290 --> 04:37.130
So before we conclude, let's quickly look into some of the important pointers here.

04:37.160 --> 04:43.280
First is that load Balancer does many things apart from just distributing the traffic among a set of

04:43.280 --> 04:43.940
servers.

04:43.970 --> 04:48.830
Now, one of the important feature of load balancer is health checking of the back end servers.

04:48.860 --> 04:53.470
For example, let's say that the server one is not working due to some reason.

04:53.480 --> 04:56.690
Load balancer can quickly identify that server.

04:56.690 --> 04:57.710
One is not working.

04:57.710 --> 05:01.200
Then what it will do, it will stop sending traffic to the server one.

05:01.220 --> 05:07.940
All the traffic will now go to the server two and after say after 15 minutes it realizes that server

05:07.940 --> 05:09.450
one is back up again.

05:09.470 --> 05:13.970
Then again, it will go ahead and send the traffic in a 5,050% based scenario.

05:13.970 --> 05:19.370
So health checking is one of the very important feature of a specific load balancer.

05:19.400 --> 05:24.980
Also note that there are multiple algorithms based on which the traffic can be distributed to the back

05:24.980 --> 05:25.660
end servers.

05:25.670 --> 05:28.340
So 5,050% is a very simplistic terms.

05:28.340 --> 05:34.520
You might need say 10% should go to server one because server one has a little less hardware size and

05:34.520 --> 05:38.890
90% of the traffic should go to server two because server two has a great hardware.

05:38.900 --> 05:44.000
So you can have X number of different configurations depending upon your use cases.

05:44.000 --> 05:50.930
And along with that load balancer can also support SSL termination and various other features as well.

05:50.960 --> 05:54.350
So this is a very high level overview about the load balancers.

05:54.350 --> 05:56.600
And with this, we'll conclude today's video.
