AWS Cloud Elasticity and Management Tools

Introduction

This article will talk about the most popular architecture in AWS. Even though docker and k8s those container technologies are popular, some traditional companies may not use it. In fact, there is a transition for traditional company from old technology to new technology. Despite that they try cloud, they still use VM based technology. Based on the VM technology, AWS provides a solution with load balancing, auto scaling and cloud watch to increase the elasticity. Previously, I had done a demonstration for this architecture.

Elastic Load Balancing (ELB)

Configuring Route53 & ELB to Optimize AWS - Metricly

Elastic load balancing (ELB) distributes traffic across multiple EC2 instances in multiple AZs. It also supports health checks to detect unhealthy EC2 instances. In addition, it supports the routing and load balancing of HTTP, HTTPS, SSL, and TCP traffic to EC2 instances.

There are 3 types of load balancers in AWS.

1. Application Load Balancer
何謂Application Load Balancer? - Elastic Load Balancing

An Application Load Balancer functions at the application layer, the seventh layer of the Open Systems Interconnection (OSI) model. After the load balancer receives a request, it evaluates the listener rules in priority order to determine which rule to apply, and then selects a target from the target group for the rule action. It is suitable for load balancing HTTP and HTTPS traffic.

2. Network Load Balancer
Amazon AWS Network Elastic Load Balancer (ELB) - ASM , Rockville , Maryland

A Network Load Balancer functions at the fourth layer of the Open Systems Interconnection (OSI) model. It can handle millions of requests per second. After the load balancer receives a connection request, it selects a target from the target group for the default rule. It is suitable for ultra-high performance, TLS offloading at scale, centralized certificate deployment, support for UDP, and static IP addresses for your application.

3. Classic Load Balancer
What is a Classic Load Balancer? - Elastic Load Balancing

A Classic Load Balancer is the legacy Elastic Load Balancer. It distributes incoming application traffic across multiple EC2 instances in multiple Availability Zones. This increases the fault tolerance of your applications. Elastic Load Balancing detects unhealthy instances and routes traffic only to healthy instances. It is suitable for an existing application running in the EC2-Classic network.

FeatureApplication Load BalancerNetwork Load BalancerClassic Load Balancer
ProtocolsHTTP, HTTPSTCP, UDP, TLSTCP, SSL/TLS, HTTP, HTTPS
PlatformsVPCVPCEC2-Classic, VPC
Health checks
CloudWatch metrics
Logging
Zonal fail-over
Connection draining (deregistration delay)
Load Balancing to multiple ports on the same instance 
IP addresses as targets 
Load balancer deletion protection 
Configurable idle connection timeout 
Cross-zone load balancing
Sticky sessions
Static IP  
Elastic IP address  
Preserve Source IP address  
Resource-based IAM Permissions
Tag-based IAM permissions 
Slow start  
WebSockets 
PrivateLink Support ✔ (TCP, TLS)  
Source IP address CIDR-based routing  
Layer 7
Path-Based Routing  
Host-Based Routing  
Native HTTP/2  
Redirects  
Fixed response  
Lambda functions as targets  
HTTP header-based routing  
HTTP method-based routing  
Query string parameter-based routing   
Security
SSL offloading
Server Name Indication (SNI) 
Back-end server encryption
User authentication  
Custom Security Policy  

The above table briefly shows the difference between these 3 types of load balancer.

Amazon CloudWatch

CloudWatch is a monitoring service for AWS cloud resources and the applications we run on AWS. It is visibility into resource utilization, operational performance, and overall demand patterns. Also, it can custom application-specific metrics of our own. And finally it is accessible via AWS management console, APIs, SDK or CLI.

We always use CloudWatch to monitor other AWS resources by graphics and statistics. Also, we could set alarms to trigger notification.

Auto Scaling

Auto scaling is a service to scale our EC2 capacity automatically. It is well-suited for applications that experience variability in usage. And it is available at no additional charge. By using auto scaling, we will have better fault tolerance, better availability and better cost management.

When we use auto scaling, we have to prepare a launch configuration to launch EC2 instances. It includes AMI ID, instance type, key pair, security groups, block device mapping and user data.

Auto scaling groups contain a collection of EC2 instances that share similar characteristics. Instances in an auto scaling group are treated as a logical grouping for the purpose of instance scaling and management. We can also create a scaling policy that uses CloudWatch alarms to determine when our auto scaling group should scale out or in.

AWS Trusted Advisor

AWS Trusted Advisor Implies The Existence Of AWS Doubted Advisor -  ParkMyCloud

Trusted advisor is a best practice and recommendation engine. It provides AWS customers with performance and security recommendations in four categories: cost optimization, security, fault tolerance and performance improvement.

Conclusion

Auto Scaling helps us ensure that we have the correct number of EC2 instances available to handle the load for our application. We use Amazon CloudWatch alarms with an auto scaling policy to determine when our auto scaling group should scale out or in. Also, we need to choose a load balancer which is suitable for us. Finally, AWS trusted advisor provides best practice and recommendation to us.

Leave a Reply