Google Cloud Platform (GCP) - What is load balancing in networking | How load balancer works?
And how you come up with that hashing algorithm. And that hashing number is based on your IP address, you source and destination IP address protocol. load balancers. We will cover some very basic topics today, and this will help you understand the basic working of load balancers and especially how load balancer works on Google Cloud.
So we'll start with some load balancer basics and Lima example to understand how exactly it works. Then we'll go on to understand some basic types of load balancers and algorithms on top of Widget works. And then we will move on to Google Cloud. Understand how Google uses load balances. What are the different types of load balancers on Google Cloud platform?
So all in all, whether you are working on GCP or not, you will definitely learn something about load balancing from this video. I'm really excited to share all my knowledge and I hope this will be a useful session for you. So without wasting any more time, let's get started.
So let's start with the basics. What is a load balancer? Now I know that most of you might already know what is a load balancer. Some might already guess by the name itself. It's so intuitive.
But as we cater to a very wide audience in this world where we have people coming from non it background, I would still like to touch base very quickly on what is a load balancer. So guys, load balancer is a device or an application which lets all your client request gets distributed to the backend servers. So this balances the load as the name suggests, and this makes sure that whatever requests are coming are equally distributed to the backend cluster or back end nodes which are managing your application.
So in this way, your load balancer ensures that there is optimal performance of your overall application and no one specific node is getting overloaded. There are other functionalities also which load balancer provide.
But in a very, very basic terms, load balancer is exactly this. Now if I have to correlate this with a layman example, take an example of a team wherein you have a Herrick wherein you have your project leader and that project leader is responsible to interact with the various business units in the company. Take the work and then pass it on to the underlying team. And that particular underline team would make sure that all the tasks which are assigned to them are worked on time. Now, within that team you might have some team leaders as well.
So suppose your project lead us interacting with the business, but underneath within its team, within his or her team, we have teams like team for Java, team for testing, team for support and operations. And then they are respective team leads which are managing their own specific team. So it would be your project leaders responsibility to take all the work from outside and pass it on to respective teams. And then it would be the responsibility of your team leads to take that work and then further pass it on to the individual associates who are working.
Now you can see that there are two different leaders working, one externally and one internally, which we will understand once we will go into the detail of types of load balancers.
So we have two types of load balancers, internal and external. We'll get into that. But how the work is managed is very similar to a load balancer because the project lead has to ensure that first of all, work is distributed as per the expertise. So the Java team should not get the testing work. First of all.
Secondly, the respective leads needs to ensure that there is equivalent load on every individual. It should not happen that one person is getting all the tasks and getting overloaded it might impact their performance. Also, suppose one team member goes off sick and goes on leaf, for example, it is the responsibility of your lead. Or maybe you can see your load balancers leads that the load is then taken out of that particular associate and distributed across other team members. So in a very lay an example, this is what load balancer does.
It takes the work from outside, run some intelligent elbows and ensures that the work is distributed in a very optimal manner. So now while we have this basic understanding of load balancer, let's try to understand some basic types of load balancing and some elbows which comes with it. So basically there are two generic types of load balancers. One is Layer seven, application level load balancer, and the other is Layer four, which is transport layer based load balancer. Now if you are confused with layer seven, layer four, go check my OSI model tutorials and for this video for the purpose of understanding, I have again given my brain hack the nugget which I created for you to remember all the seven OSI layers with all people should try new Dominoes Pizza, which comes out to be the application layer, the presentation layer, the session layer, the transport layer, the network layer, the data link, and the physical layer.
So whenever you are doing a communication from one network to another network, all these layers of the OSI model comes into picture. So you have your load balancers sitting in maybe at the top at the application layer, or maybe at the transport layer. And then there are different protocols which supports this, which we will understand in mode detail in the later section of the video. But for now let's understand that only understand that you will have applications with the name suggests. Right?
So application layer has protocols like http, https. So whenever you want to do content based load balancing, or suppose you have a plane website and you want that website based on the data you are entering using Https protocol. You want the load balancer to work. So basically what you are trying to do here is you are trying to set up a application and application level load balancer where when we talk about the internal load balancers, the network base load balancers, or the load balancers based on TCP protocol or UDP protocol.
Those load balancers are based on layer four.
So always remember that these are the two main types of load balances which we come across with. And then there are various versions operate based on the protocol based on the functionalities which we will understand context of Google Cloud. Now coming to algorithm how load balancer decides that how I will distribute the traffic. Okay, so these are some algorithms which I thought of sharing with you in a very quick manner. One is round Robin.
Round Robin is very, very simple way of doing it. So you pick any server in a round Robin manner and then pass on the loop to that particular server. Initially, the DNS servers. Until today, DNS servers do play this kind of role. When there were no load balancer.
Your DNS server used to do this job. Until today, it is in use. Least connection, very self accumulatory. The load balancer will check that took out of all the nodes in my cluster, which particular node has the least amount of connections and then pass on the pass on the a request to that particular server. Very good.
When you are talking to maybe backend database servers with multiple nodes on maybe an Oracle RAC, and then you would want to see that which Oracle instance has the least connection, least response time. So the response time, whichever node is giving you the least response time, proves that it is the most effective load balancer in terms of performance and the load. So you might want to go with that least bandwidth. Now, I also understand that, you know, it is kind of that once you identify that. Okay, these servers have the least bandwidth, then you might want to go to a node where you have more bandwidth, and at the end we have hashing.
Now, in hashing, you generate a hash. Using a hash algorithm, you generate a sequence with which you decide that this particular load balancer needs to be pulled in and how you come up with that hashing algorithm. And that hashing number is based on your IP address, your source and destination IP address protocol, your header data which is coming. So using all that, the hashing algorithm will pick and choose any particular node. So these algorithms are topic in its own way.
But just to let you know that these are some ways how load balancer decides that this particular node is the right one to take the load. So now this is the generic type. Now we'll go into more detail and now we'll go into the GCP arena, try to understand what kind of load balancing types we have on Google cloud. But it is generic guys. So even if you are on Amazon or in your Azure world, most of these concepts would be slightly similar.


0 Comments