Fundamentals of AWS (Part 2) & RDS, Aurora, Elasticache Flashcards
Define Scalability
Scalability means that an application / system can handle greater loads by adapting.
What are the two kinds of Scalabilty?
- Vertical Scalability
* Horizontal Scalability (= elasticity)
Define Vertical Scalability?
Vertically scalability means increasing the size of the instance
What’s a case where scalability is very common?
databases
Name some services that can scale vertically
RDS, ElastiCache are services that can scale ver tically.
Define Horizontal Scaling
Horizontal Scalability means increasing the number of instances / systems for your application
What’s high availability and what purpose does it serve?
High availability means running your application / system in at least 2 data centers (== Availability Zones)
• The goal of high availability is to survive a data center loss
What can you use to horizontal scale: Increase number of instances?
Auto Scaling Group
• Load Balancer
What’s an application of High Availability?
Run instances for the same application across multi AZ
What are load balancers?
Load balancers are servers that forward internet traffic to multiple servers (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
- 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
What’s an ELB?
EC2 Load Balancer - is a managed load balancer
What are the three types of Load Balancers?
Classic Load Balancer (v1 - old generation) - 2009
• Application Load Balancer (v2 - new generation) - 2016
• Network Load Balancer (v2 - new generation) - 2017
• Overall, it is recommended to use the newer / v2 generation load balancers as they provide more features
What are LB Health Checks?
- Health Checks are crucial for Load Balancers
- They enable the load balancer to know if instances it forwards traffic to are available to reply to requests
- The health check is done on a port and a route (/health is common)
- If the response is not 200 (OK), then the instance is unhealthy
What all do Application Load Balancers (ALB) allow you to do?
Application load balancers (Layer 7) allow to do:
• Load balancing to multiple HTTP applications across machines (target groups) • Load balancing to multiple applications on the same machine (ex: containers) • Load balancing based on route in URL
• Load balancing based on hostname in URL
What are ALB’s good for?
for micro services & container-based application (example: Docker & Amazon ECS)
Stickiness can be enabled at what level?
Stickiness can be enabled at the target group level
• Same request goes to the same instance
• Stickiness is directly generated by the ALB (not the application)
Network load balancers (Layer 4) allow to do:
Forward TCP traffic to your instances
• Handle millions of request per seconds
• Support for static IP or elastic IP
• Less latency ~100 ms (vs 400 ms for ALB)
ALB can route based on hostname / path?
True
• Support routing based on hostname (users.example.com & payments.example.com)
• Support routing based on path (example.com/users & example.com/payments)
ALB is a great fit with ___?
ECS (Docker)
Any Load Balancer (CLB, ALB, NLB) has a ____ host name?
Static
LB’s Scale instantaneously?
False
NLB directly see this___?
client IP
_xx errors are client induced errors? 4 or 5?
4
_xx errors are application induced errors. 4 or 5?
5 - Load Balancer Errors 503 means at capacity or no registered target
Check this if your LB can’t connect to your application.
Security Groups
Explain LB stickiness.
It is possible to implement stickiness so that the same client is always redirected to the same instance behind a load balancer
What kind of LB’s does stickiness work for?
This works for Classic Load Balancers & Application Load Balancers
The “cookie” used for stickiness doesn’t have an expiration date you control?
False - You control the expir date
How does ALB support dynamic host port mapping?
With ECS
For public facing NLB - must attach this to maintain static IP per AZ
Elastic IP
Private facing: will get random private IP based on free ones at time of creation? True of False
True
The Lb uses what kind of SSL/TLS certificate?
X.509
How do you manage AWS certificates?
ACM (AWS Certificate Manager)
What’s an Auto Scaling Group (ASG)?
The goal of an Auto Scaling Group (ASG) is to:
• Scale out (add EC2 instances) to match an increased load
• Scale in (remove EC2 instances) to match a decreased load
• Ensure we have a minimum and a maximum number of machines running • Automatically Register new instances to a load balancer
Use ____ as the scaling policy for ASG
CloudWatch Alarm
An ASG Launch Configurations includes?
- AMI + InstanceType
- EC2 User Data
- EBSVolumes
- Security Groups
- SSH Key Pair
____ attached to an ASG will get assigned to EC2 instances??
IAM roles
What do you pay for when using an ASG?
ASG’s are free. You pay for the underlying resources being launched
Having instances under an ASG means that if they get terminated for whatever reason, the ASG will restart them. T/ F?
True
ASG’s will not terminate an instance marked as unhealthy by a LB?
False - It was terminate if marked unhealthy
Define ASG Default Termination Policy (simplified version)
- Find the AZ which has the most number of instances
2. If there are multiple instances in the AZ to choose from, delete the one with the oldest launch configuration
What’s the ASG The cooldown period?
Thecooldownperiod helps to ensure that yourAutoScaling group doesn’t launch or terminate additional instances before the previous scaling activity takes effect.
What’s an EBS Volume?
• An EC2 machine loses its root volume (main drive) when it is manually terminated.
• Unexpected terminations might happen from time to time (AWS would email you)
• Sometimes, you need a way to store your instance data somewhere
• An EBS (Elastic Block Store) Volume is a network drive you can attach
to your instances while they run
• It allows your instances to persist data
is EBS locked to AZ?
- It’s locked to an Availability Zone (AZ)
* An EBS Volume in us-east-1a cannot be attached to us-east-1b • To move a volume across, you first need to snapshot it