AWS Fundamentals: ELB + ASG Flashcards
What does “Scalability” mean?
An application’s / system’s ability to handle greater loads by adapting
Two kinds of scalability?
- Horizontal - elasticity
- Vertical
Vertical Scalability means..
increasing the size of your instance
What is “Vertical Scalability” common for?
Non distributed system such as a database
What are the limits of “Vertical Scalability”
Hardware limits
Horizontal Scalability means…
increasing the number of instances/systems for your application
What is “distributed systems”?
a collection of computer programs that work together to complete a task or provide a service.
Horizontal Scaling implies…
you have distributed systems
What is “High Availability”?
Running your application / system in at least two data centers (availability zones)
Main goal of “high availability”
survive data center loss
What is “load balancing”?
servers(behind the scene servers) forward traffic to multiple servers (e.g. EC2 instances) downstream
Why use a load balancer?
- Spread load across multiple downstream instances
- Expose a single point of access (DNS) to your application
- Seamlessly handle failures of downstream instances
- Provide SSL termination (HTTPS) for you websites
- Enforce stickiness with cookies
- High availability across zones
- Separate public traffic from private traffic
What is an “elastic load balancer”?
A managed load balancer that:
- AWS guarantees that it will be working
- AWS takes care of upgrades, maintenance, high availability
- AWS provides only a few configuration knobs
What are “Health Checks”?
Enables the load balancer to know if instances it forwards traffic to are available to reply to requests
Where are health checks done?
on a port and a route (/health is common)
4 types of load balancers on AWS:
1.Classic Load Balancer(deprecated)
- Application Load Balancer
- Network Load bBalancer
- Gateway Load Balancer
Some load balancers can be set up as ….. or …….. ELBs
internal (private), external (public)
Users can access your load balancer from……. using…… or……..
anywhere, HTTP, HTTPS
EC2 instances should only allow traffic coming directly from the load balancer.
True
How does an ECS instance allow only a load balancer to forward traffic to it?
With a security group
What does an ALB forward traffic to?
Multiple HTTP applications across machines (target group)
or
multiple applications on the same machine (ex: containers)
What are the 3 different target groups that routing can be based on?
- Routing based on path in URL
- Routing based on hostname in URL
- Routing based on query strings, headers
Features:
- EC2 instances (can be managed by Auto Scaling Group) - HTTP
- ECS tasks ( managed by ECS itself) - HTTP
- Lambda functions - HTTP request is translated into a JSON event
- IP addresses - must be private IPs
- ALB can route to multiple target groups
Application Load Balancer (v2) Target Groups
ALB can route to multiple target groups?
True
Where are health checks done?
At the target group level
ALB has a Fixed host name?
True
The application servers don’t see the IP of the client directly?
True
Where can the true IP of the clients be found?
in the header X-Forwarded-For.
What does a Network Load Balancer allow?
- Forward TCP & UDP traffic to your instances
- Handle millions of request per seconds
- Less latency ~100 ms (vs 400 ms for ALB)
What are NLB used for?
Extreme performance,TCP or UDP traffic
Features:
- EC2 instances
- IP Addresses – must be private IPs
- Application Load Balancer
Network Load Balancer – Target Groups
What is the idea of “Sticky Sessions”?
the same client is always redirected to the same instance behind a load balancer
Which load balancers does sticky sessions work with?
- Classic Load Balancer
- Application Load Balancer
- Network Load
Note:
NLB works without cookies
Which load balancers have a “cookie” that expires?
CLB & ALB. User controls “cookie” expiration.