AWS Auto Scaling Groups and Load Balancing

AWS Auto Scaling Groups and Load Balancing

                Load Balancing and Auto Scaling are some of the important features of cloud computing which makes it more beneficial than traditional computing. This is are the factors that can affect the overall working of the application and also change the resources according to the needs. Let's see in detail about them and the Services which was offers to solve these needs.

AWS Auto Scaling

                First, let's understand what actually Auto Scaling means, and why it cames our lives more simple. Suppose you have setuped your application or website in the cloud and waiting for customers. But when there are peak loads or no traffic what happened to instances that are hosting your service. They are more likely to be Overloaded or Underused and both are not helpful for the successful running of your business, so the problem is here with the instances are not available according to the needs or traffic sometimes they are low instances, and sometimes they are over. This is where Auto Scaling comes into the picture, it allows you to automatically launch and terminate instances based on the load and other metrics. We can implement this using Auto Scaling Groups



Amazon Auto Scaling Groups

                An Auto Scaling group is a group of instances that are configured based on specific requirements and metrics. Let's understand this with a simple example, We want to launch a web application in the cloud, and we need around 3 instances to do so, but we don't know the actual amount of instances required during peak and low loads of traffic. So we add all the instances into an Auto Scaling group that are of similar kinda and does similar work. The Auto Scaling Group has 3 Parameters that are useful for its execution they are 

  • Minimum no of Instances
  • Desired Instances
  • Maximum no of Instances
                
                Let's see in detail about each parameter, First the Minimum no of EC2 instances which always run. These are the no of instances initialized when you create an Autoscaling group. Next, is Desired Instances which are the number of instances that you think are right for running the web applications without any interruptions. Last is the Maximum no of instances which are the no of instances the security groups can launch to fulfill the traffic needs, The auto-scaling group will not launch instances more than the maximum no of instances.

                We are all good with our Web Applications but hold on there is one more need which has to be satisfied, think like you have launched as many as instances to fulfill the needs, but what if all the traffic is directed to on instances and other instances are idle. This is another important aspect which needs to solve. AWS Elastic Load Balancing is the right Service to solve this issue.

AWS Elastic Load Balancing

                Traffic Control is a major aspect that will also affect the working of your application. You have setuped all Instances, Auto scaling groups but the traffic flows don't know where to go, the whole traffic can be directed towards on instances and it will be overloaded and crashes, so there need to be some supervisor kind of thing which monitors all the traffic over the cloud. Its time for another example, Suppose you want to book a train ticket and for this, you are made to stand in long queues, and there are four such queues and among them one has will take less time to complete the booking, as usually you will be heading to that counter but the network doesn't have this intelligence that's where we use load balancing.



                If there is a Watchmen who directs the new customer to the least loaded queue then the whole process will be simple and no interruptions can occur. The role of Elastic Load Balancing is also the same, Whenever it gets the traffic from customers etc, it redirects the flow evenly to all the instances. Autoscaling group and Load balancing can work together are enhance the experience. If the load balancer finds the traffic is less than the available instance then it automatically terminates the instances, if the traffic is more it automatically loads new instances and directs traffic to new instances, in this way all the instances work without overload. There are 3 Types of Load Balancers.

  • Application Load Balancing
  • Network Load Balancing
  • Classic Load Balancing

                Application Load Balancing works at the application level of traffic control or level 7 of the OSI model learn more about OSI mode here What is OSI Model. It deals with end-to-end user applications like HTTP/HTTPS, SSH, etc. The Network load balancing deals with the network layer or the 3 layers in the OSI model, it routes traffic based on the IP address and protocols like TCP/UDP it reviews every request and sends the request to appropriate designation according to the network groups or type of request. It can handle a large number of requests at a time and provide very low latency services. The third type is Classic Load Balancing. It works as a combination of both network and application load balancing it distributes traffic over multiple EC2 instances groups, IP address Subnets, and even Containers.

AWS Auto Scaling and Load Balancing

                In most Real-time Scenarios, Auto Scaling Groups are used in conjunction with Load Balancing and they both can enhance each other's functionalities. The load balancing can take of the incoming traffic and the Groups can initialize the right amount of resources every time. Suppose the on a certain day the inbound traffic is high then the load balancer alerts the Auto Scaling group which creates more instances of EC2 to satisfy the traffic needs. When the instances are ready to take requests it sends information to the load balancer then the load balancer sends requests to newly created instances, in this way the loads are distributed across the instances without overloading. In the end of the day when the traffic needs are satisfied and we don't need additional instances, the Load Balancer will again alert the Auto Scaling group which terminates the additional Instances.

Post a Comment

Previous Post Next Post