HA & Scaling Flashcards
What can you use in the absence of a LB?
You can use Route 53 or Multi-Value Routing which uses DNS.
DNS, where a single DNS instance might point to multiple backend servers.
This is not ideal however as failover is handled on the client side.
Does a client point to the end server when using a LB?
No - Users do not connect to a server running an app, they instead point at/connect to the LB in the middle.
The LB will “listen” for traffic on specific ports/protocols - like HTTP and HTTPS i.e 80 and 443; if applied it becomes a “Listener” on those ports.
LB Intro Summary
· Clients connect to the LB, not the application.. specifically, they connect to the Listener of the LB.
· LB connects on the client behalf to 1 or more targets/servers
· 1 connection between client/listener and another between the LB/backend instance - they are 2 separate connections
· LB’s job to abstract the client away from individual servers - this allows for HA/scaling/fault tolerance
Can a LB run health checks?
Yes - LB’s will generally run health checks to all of the servers it’s connected to, so if a server fails, it will stop sending traffic to that server and the client/user will never know
What is an Elastic LB (ELB)?
This is an umbrella term in AWS that refers to Classic LB, App LB, and/or Network LB.
The Classic LB is basically the original ELB that was succeeded by the ALB and then the NLB.
What is an App LB?
Layer 7- LB
The ALB is capable of understanding the App Layer i.e L7 and can take action based on things within those L7 protocols.
Are ALB’s public or private?
They can be either.
If PUBLIC - they can Listens on the OUTSIDE interface (public IP) and then sends to TARGETS or Target Groups.
If PRIVATE - has no public address and only LB’s traffic within the VPC that it’s in or between tiers of a multi-tier App.
What is an LB Capacity Unit? (LCU)
An LCU is a new metric for determining how you pay for an Application Load Balancer. An LCU defines the maximum resource consumed in any one of the dimensions below:
○ constitutes for 25 new connections per second
○ 3k active connections per minute
○ 1GB per hour with EC2/containers as targets or 0.4 GB/hour for Lambda functions as targets
What is Cross-Zone LB?
What is it the feature solving for?
A feature within the AWS LB that was introduced to enforce the ability for every LB Node, that an ALB DNS name points to, to distribute connections that they receive across all EC2 in all AZ’s that are registered to the LB.
Ex) The app has EC2’s in multiple AZ’s - the ALB can load balance traffic across all of them, where LB-B in AZ-B can send traffic directly to EC2’s in AZ-A.
Solving for if there are 10 EC2’s in AZ-A and 2 x EC2’s in AZ-B, where the traffic is split 50/50 by the LB. This would be very uneven in terms of load because AZ-B would split 50% of traffic between 2 instances and AZ-A would do the same across 10.
ALB ARCH Terms:
○ Targets - services that an ALB can distribute services/connections to (like EC2, containers running ECS, Lambda, etc.)
○ Group - a grouping of targets that represent the same service; ALB’s distribute connections amongst Targets within the Group
○ Rules - the options are:
- Host Rules - use different DNS names –> EX) sports.com/nfl is TG-A and sports.com/mlb is TG-B
- Path Rules - interpret different paths within the HTTP address and direct incoming requests to different Target Groups –> EX) nfl.sports.com is TG-A and mlb.sports.com is TG-B
ALB Summary:
→ has a listener config that controls exactly what ports/protocols it’s listening for
→ Has host-based or path-based rules which direct those incoming connections to different target group(s)
→ A target group is a collection of targets
→ A target can be an EC2 instance, container, or lambda function (a COMPUTE resource)
· Targets = a compute resource that connections are directed towards (EC2, containers, Lamda, etc)
· Target Groups = groups of targets which are addressed with Rules
· Rules = path-based or host-based
· Supports EC2, ECS, EKS, Lambda, HTTPS, etc.
· Classic LB (legacy) only exists for legacy reasons and are not recommended moving forward
** if you need to deploy multiple SSL Certificates to a single LB, you’d have to use an ALB (Classic LB does not support this) **
What do Launch Configs and Launch Templates aim to achieve?
Both of these tools perform the same task - they allow you to define the config on an EC2 instance in advance.
Anything you define at the point where you launch an instance, you can define ahead of time with their of these 2 methods:
○ AMI, Instance Type, Storage and Key Repair
○ Networking/SEC group
○ User Data & IAM Role (for permissions)
Can you edit Launch Configs or Launch Templates?
No - Neither of these are editable, they are defined ONCE.
With LT’s however you can create different versions.
What is an Auto-Scaling Group?
Feature within AWS that allows the auto-scale and self-healing of EC2 instances i.e if an instance fails, it will kill the instance and auto-provision a new one based on a Launch Config or Launch Template that it’s linked with.
What are the 3 important values/parameters with ASGs?
You must define these 3 things for what the group will provision from an EC2 instance perspective:
Minimum
Maximum
Desired
ASG will provision or terminate EC2 instances within the min/max threshold based on how many are provisioned and what the desired state is.