Table of Contents
- Introduction
- Autoscaling Group
- Load Balancing
- Target Group
- Load Balancer
1. Introduction
In this pose, we will talk about high availability architecture. There are two concept that are closely related to high availability architecture:
- Autoscaling Group
- Load Balancing
Autoscaling Group is more about the computing unites and load balancing is more about architecture and how the traffic is distributed.
The diagram below gives an example of classic HA architecture:

User sends requests to a domain, AWS Route53 routes the requests to a registered load balancer. Depending on the configuration and request type, load balancer will send the received requests to the corresponding target group. Target group is a collection of computing units (e.g. EC2 instances or autoscaling group). The computing units may connect to other scalable services such as S3 and RDS.
Some of the requests will be forward to and then handled by CloudFront, which is a content distribution service and its edge locations are closer to end user.
2. Autoscaling Group
Autoscaling Group is a collection of EC2 instances that can dynamically adjust its capacity based on the real-time workload and configuration. ASG uses a launch template/configuration to launch new EC2. We can specify information such as the AMI ID, instance type, key pair, security groups and block device mapping for the instances.
There are two usages of ASG:
- Make application scalable
- Make application high available
The first item is quite obvious because it's called autoscaling group. The second item is a by-product of specifying the minimum number of instances that a ASG needs to maintain. For example, if we have ASG with minimum number of instances equals to 1 and the EC2 instance fails, then ASG will create a new EC2 instance automatically. In this ways, we always have a EC2 instance running. (There is a gap between the time when EC2 fails and the time when the new instance is created by ASG.)
There are different types of scaling options
- Maintain current instance levels at all times
- Scale manually
- Scale based on a schedule
- Scale based on demand
- use predictive scaling.
3. Load Balancing
There are three types of load balancer
- Application Load Balancer (ALB)
- Http, Https, Layer 7
- They are intelligent, and you can create advanced request routing, sending specified requests to specific web servers.
- Network Load Balancer (NLB)
- They are best suited for load balancing of TCP traffic where extreme performance is required.
- Operating at the connection level (level 4)
- Network Load Balancer are capable of handling millions of requests per second, while maintaining ultra-low latencies.
- Use for extreme performance.
- Classic Load Balancer (CLB or ELB (Elastic Load Balancer))
- It seems that this load balancer just perform a round robin load balancing.
Application Load Balancer can route requests to different target groups. To achieve this, we can specify rules in the ALB.

Some other concepts related to load balancing
- Sticky Sessions: It enables your users to stick to the same EC2 instance. Can be useful if you are storing information locally to that instance.
- Cross Zone Load Balancing: It enables you to load balance across multiple availability zones.
- Path Patterns: It allows you to direct traffic to different EC2 instances based on the URL contained in the request.
- X-Forwarded-For Header: This allows the application to get the IP address of the end user.

----- END -----
©2019 - 2022 all rights reserved