Load Balancer Flashcards
Means that an application / system can handle greater loads by adapting.
Scalability
What are the 2 types of Scalability
Vertical
Horizontal
Icreasing the size of the instance
Vertical Scalability
Vertical scalability is very common for ___________, such as a ____________.
non distributed systems
database
What are 2 types of services that can scale vertically?
RDS
ElastiCache
Is there’s usually a limit to how much you can vertically scale and WHY????
YES
Hardware limit
Means increasing the number of instances / systems for your application
Horizontal Scalability
____________ scaling implies distributed systems.
Horizontal
Very common for web applications /
modern applications
Horizontal Scalability
___________ usually goes hand in hand with horizontal scaling
High Availability
Means running your application / system in at least 2 data centers (== Availability Zones)
High Availability
What is the goal of high availability?
survive a data center loss
The high availability can be _________ (for RDS Multi AZ for example)
passive
The high availability can be _______ (for horizontal scaling)
active
Are servers that forward traffic to multiple servers (e.g., EC2 instances) downstream
Load Balances
READ ALL OF THESE
* Spread load across multiple downstream instances
* Expose a single point of access (DNS) to your application
* Seamlessly handle failures of downstream instances
* Do regular health checks to your instances
* Provide SSL termination (HTTPS) for your websites
* Enforce stickiness with cookies
* High availability across zones
* Separate public traffic from private traffic
Load Balances
They enable the load balancer to know if instances it forwards traffic to are available to reply to requests
Health Checks
The health check is done on a ______ and a ________
port
route
If the response is not __________ (OK), then the instance is unhealthy
200
AWS has 4 kinds of managed Load Balancers
Classic Load Balancer
Application Load Balancer
Network Load Balancer
Gateway Load Balancer
(v1 - old generation) – 2009 – * HTTP, HTTPS,TCP,SSL(secureTCP)
* Supports TCP (Layer 4), HTTP & HTTPS (Layer 7)
* Health checks are TCP or HTTP based
* Fixed hostname XXX.region.elb.amazonaws.com
Classic Load Balancer
(v2 - new generation) – 2016 – * HTTP, HTTPS,WebSocket
* Is Layer 7 (HTTP)
* Load balancing to multiple HTTP applications across machines (target groups)
* Load balancing to multiple applications on the same machine (ex: containers)
* Suppor t for HTTP/2 and WebSocket
* Support redirects (from HTTP to HTTPS for example)
Application Load Balancer
(v2 - new generation) – 2017
* TCP,TLS(secureTCP),UD
Network Load Balancer
2020 –
* Operates at layer 3 (Network layer) – IP Protocol
Gateway Load Balancer
What are the 3 ways of Application Load Balancer routing tables to different target groups
Routing based on path in URL
Routing based on hostname in URL
Routing based on Query String, Headers
are a great fit for micro services & container-based application (example: Docker & Amazon ECS)
Application Load Balancer (ALB)
Does ALB have a port mapping feature to redirect to a dynamic port in ECS?
YES
Application Load Balancer (v2) Target Groups (4)
EC2 instances (can be managed by an 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
Can ALB’s route to multiple target groups
YES
For ALB’s, Health checks are at what level?
target group level
READ EVERYTHING
* Fixed hostname (XXX.region.elb.amazonaws.com)
* The application servers don’t see the IP of the client directly
* The true IP of the client is inserted in the header X-Forwarded-For
* We can also get Port (X-Forwarded-Port) and proto (X-Forwarded-Proto)
Application Load Balancer (v2)
(Layer 4) allow to:
* Forward TCP & UDP traffic to your instances
* Handle millions of request per seconds
* Less latency ~100 ms (vs 400 ms for ALB)
Network Load Balancer (v2)