Section 8: High Availability and Scalability, ELB & ASG Flashcards
What are the two types of scalability?
Horizontal Scaling and Vertical Scaling
Define Vertical Scalability and its use cases
Vertical scaling is increasing / decreasing the instance size/power (from regular EC2 to baremetal, for example).
Use Cases: non-distributed systems, like DBs, and when you have a hardware limit for scaling
Define Horizontal Scalability and its use cases
Horizontal Scaling (elasticity) is increasing / decreasing the number of instances.
Use Cases: Distributed systems (web apps, modern apps) & ASGs / load balancers
High availability and ____ go hand in hand
Horizontal Scaling (for running instances for the same app, across multiple AZs
What is the goal of High availability?
To survive an unexpected data center loss
What is a load balancer?
Load balancers are physical / virtual servers that forward traffic to multiple servers (EC2 instances) downstream. They do not need to be internet facing.
What are some reasons to use a load balancer? 5 things.
1) Spread load across multiple downstream instances
2) Expose a signle point of access (DNS) to your application
3) Easily handle failure of downstream instances
4) Separate private and public traffic
5) regular health checks and SSL termination (HTTPS) for websites
What are the four (4) types of Elastic Load Balancers (ELBs)?
1) ALB (application load balancer)
2) Network Load Balancer (NLB)
3) Gateway Load Balancer (GLB)
4) Classic Load Balancer (CLB)
When should you use an ALB?
ALBs are best suited for load balancing of HTTP, Websocket & HTTPS traffic. They provide a static DNS name but not a static IP.
What level do ALB’s perform health checks
ALBs perform health checks at the target group level. Target groups include EC2 instances, Lambda Functions, IP addresses, and more.
What are two ALB use cases
1) Micro Services
2) Container based applications (docker, amazon ECS)
When should you use an NLB?
NLBs are suited for load balancing of TCP (transmission control protocol) traffic where extreme performance is required
What are three (3) main qualities of NLBs?
1) provides Static DNS name and Static IP
2) Can support millions of requests per second and ultra-low latencies compared to ALB
3) NLBs are meant for extreme performance, TCP and UDP traffic
When should you use a GLB?
A GLB should be used when network traffic must be inspected before sending it to an application
What are some use cases for GLB?
1) firewalls, intrusion detection, preventative systems
2) deploying, scaling and managing a fleet of 3rd party network virtual appliances
What re some use cases for CLB (Classic load balancer?)
None. CLBs are deprecated.
What are Sticky Sessions (session affinity) and what do they do?
Sticky Sessions bind a user’s session to a specific EC2 instance or target (ALB).
Sticky Sessions ensure all requests from the user will be sent to the same place to make sure the user doesn’t lose session data
What are two cons of Sticky Sessions?
1) If you aren’t getting connected to a specific EC2 instance, you might need to disable Sticky Sessions
2) Enabling stickiness can bring imbalance to the load
Stickiness is achieved by using two types of cookies. What are these cookies called?
1) Application based cookies
2) Duration based cookies
What are Application Based Cookies?
Application Based Cookies are generated by an an application or a load balancer, named specifically for each target group
What are Duration Based Cookies?
Cookie generated by a load balancer, named AWSALB for ALBs, AWSELB for CLB
What is Cross Zone Load Balancing?
When a load balancer balances a load evenly across targets in Multiple AZs
What if Cross Zone Load Balancing is not enabled?
Requests will be distributed in the instances of the load balances, but no guarantee the loads will be balanced across AZs. Cross Zone is always on for ALBs
What if Cross Zone Load Balancing is not enabled?
Requests will be distributed in the instances of the load balances, but no guarantee the loads will be balanced across AZs