High Availability and Scalability: ELB & ASG Flashcards
What is scalability?
Means your application can adapt to accommodate for greater loads
What are the 2 kinds of scalability
Vertical
Horizontal (elasticity)
Vertical Scalability
Increasing the Size of the instance
Common use case of Vertical scalability?
Non distributed systems such as database
RDS, Elasticache
What is the limit of Vertical Scalability?
Hardware limit
Horizontal Scalability
Increase the number of instances/systems for your app
What does horizontal scaling implies?
That you have distributed systems
What is horizontal scalability most common for?
Web apps / modern apps
What is High Availability?
Means running your app / system in at leas 2 data centres (AZ)
Goal of HA?
Survive a data centre loss
HA can be passive and also active. Give 2 examples
Passive - RDS Multi AZ
Active - Horizontal Scaling
What type of scalability is Auto Scaling Group & Load balancer part of?
Horizontal Scaling
What is Auto Scaling Group multi AZ & Load Balancer multi AZ part of?
High Availability
What is a Load Balancer (ELB)
servers forward traffic to multiple servers (EC2 instances) down stream
What can provide Spreading of load across multiple downstream instances?
ELB
What can expose single point of access (DNS) to your app?
ELB
What can seamlessly handle failures of downstream instances?
ELB
What can do regular health checks to your instances?
ELB
What can provide SSL termination (HTTPS) for your websites?
ELB
What can enforce stickiness with cookies?
ELB
What can provide HA across zones?
ELB
What can separate public traffic from private traffic?
ELB
ELB is integrated with
EC2, EC2 Auto Scaling Groups, Amazon ECS
AWS Certificate Manager (ACM), CloudWatch
Route 53, AWS WAF, AWS Global Accelerator
How do ELB do health checks of EC2 instances?
Have a dedicated port and a route. Its important to know when to not send traffic to an instance if its down
What does the instance response need to be to be healthy?
200 OK
How many types of ELB are there on AWS?
4
What are the types of ELB?
- Classic Load Balancer (HTTP, HTTPS, TCP, SSL (Secure TCP)
- Application Load Balancer (HTTP, HTTPS, WebSocket)
- Network Load Balancer (TCP, TLS (secure TCP), UDP)
- Gateway Load Balancer (layer 3 (Network Layer)) - IP protocol
Load Balancer Security Groups Architecture
Users use HTTPS/HTTP From anywhere to connect to Load Balancer. The SG on LB allows 80 (HTTP) and 443 (HTTPS).
The SG of the EC2 instance ONLY allows the SG from the LB to connect via HTTP (80). So the source will not be an IP, but the SG name. And allow traffic only.
Which OSI Layer is Application LB?
7 - ONLY HTTP
What does Application LB have support for?
HTTP/2 & WebSocket
Does Application LB support redirects?
Yes from HTTP to HTTPS
What are ALB great for?
Micro services & container-based applications
(Docker & Amazon ECS)
ALB can route, to different target groups. Give an ex.
example.com/users & example.com/posts
Benefit of ALB
You can have just 1 for multiple applications
ALB Architecture example
1 App Load Balancer routing www.example.com/user to HTTP target group for Users (2 EC2) and also routing example.com/search to another target group for Search applications that have 2 different EC2 instancesd
What are Target Groups?
Can be
1. EC2 instances (managed by ASG) HTTP
2. ECS tasks (ECS managed) HTTP
3. Lambda Functions - HTTP req is translated into a JSON event
4. IP Addr - must be private IP
Can ALB route to multiple target groups?
Yes
Where are the health checks done with an ALB?
Target Group Level
What can you do with an ALB to redirect 2 different types of traffic to 2different target groups?
Write Query Strings/Parameters
How does the Client IP talk to EC2 instance with an ALB in the middle?
ALB uses Connection Termination which takes the client public IP and then uses the Load Balancers Private IP to talk to the EC2 instance