Section 8: High Availability and Scalability, ELB & ASG Flashcards

1
Q

What are the two types of scalability?

A

Horizontal Scaling and Vertical Scaling

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Define Vertical Scalability and its use cases

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Define Horizontal Scalability and its use cases

A

Horizontal Scaling (elasticity) is increasing / decreasing the number of instances.
Use Cases: Distributed systems (web apps, modern apps) & ASGs / load balancers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

High availability and ____ go hand in hand

A

Horizontal Scaling (for running instances for the same app, across multiple AZs

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the goal of High availability?

A

To survive an unexpected data center loss

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is a load balancer?

A

Load balancers are physical / virtual servers that forward traffic to multiple servers (EC2 instances) downstream. They do not need to be internet facing.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are some reasons to use a load balancer? 5 things.

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are the four (4) types of Elastic Load Balancers (ELBs)?

A

1) ALB (application load balancer)
2) Network Load Balancer (NLB)
3) Gateway Load Balancer (GLB)
4) Classic Load Balancer (CLB)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

When should you use an ALB?

A

ALBs are best suited for load balancing of HTTP, Websocket & HTTPS traffic. They provide a static DNS name but not a static IP.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What level do ALB’s perform health checks

A

ALBs perform health checks at the target group level. Target groups include EC2 instances, Lambda Functions, IP addresses, and more.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What are two ALB use cases

A

1) Micro Services
2) Container based applications (docker, amazon ECS)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

When should you use an NLB?

A

NLBs are suited for load balancing of TCP (transmission control protocol) traffic where extreme performance is required

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are three (3) main qualities of NLBs?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

When should you use a GLB?

A

A GLB should be used when network traffic must be inspected before sending it to an application

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What are some use cases for GLB?

A

1) firewalls, intrusion detection, preventative systems
2) deploying, scaling and managing a fleet of 3rd party network virtual appliances

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What re some use cases for CLB (Classic load balancer?)

A

None. CLBs are deprecated.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What are Sticky Sessions (session affinity) and what do they do?

A

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

18
Q

What are two cons of Sticky Sessions?

A

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

19
Q

Stickiness is achieved by using two types of cookies. What are these cookies called?

A

1) Application based cookies
2) Duration based cookies

20
Q

What are Application Based Cookies?

A

Application Based Cookies are generated by an an application or a load balancer, named specifically for each target group

21
Q

What are Duration Based Cookies?

A

Cookie generated by a load balancer, named AWSALB for ALBs, AWSELB for CLB

22
Q

What is Cross Zone Load Balancing?

A

When a load balancer balances a load evenly across targets in Multiple AZs

23
Q

What if Cross Zone Load Balancing is not enabled?

A

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

24
Q

What if Cross Zone Load Balancing is not enabled?

A

Requests will be distributed in the instances of the load balances, but no guarantee the loads will be balanced across AZs

25
Q

What Does an SSL (Secure Socket Layer) / TSL (Transport Layer Security) certificate do?

A

SSL certificates allow traffic between your clients and your load balancer to be encrypted in transit (in-flight encryption)

26
Q

How does SSL / LS work with load balancers?

A

1) User connects to load balancer via HTTPs
2) Load Balancer verifies if network is encrypted
3) Load Balancer navigates encrypted traffic to EC2 Instance

27
Q

What is SNI (Server Name Indication) and what does it do?

A

SNI allows users to load multiple SSL certificates into one or different web servers via load balancers. Only applicable to ALB / NLB / CloudFront, and all traffic is HTTPS

28
Q

What are the four (4) main goals of an ASG (Auto Scaling Group)?

A

1) Scale out (add EC2 instances) to match increased load
2) Scale in (remove EC2 instances) to match decreased load
3) ensure a minimum and maximum amount of machines running
4) Automatically register new instances to a load balancer

29
Q

Can you assign IAM roles to an ASG?

A

Yes. IAM roles attached to an ASG will get assigned to the correlative EC2 instances

30
Q

How much does an ASG cost?

A

ASG’s are free, you only pay for the underlying resources launched in the ASG

31
Q

What happens if an instance in an ASG fails a health check?

A

the ASG will automatically create a new instance as a replacement

32
Q

What are the attributes of an ASG?

A

1) Launch configuration (resources to be used, SGs, Storage, etc.)
2) Min / Max size, Initia; / desired capacity
3) Network, load balancer & subnet information
4) Scaling policies (what triggers a scale in or scale out)

33
Q

What are the two types of Automatic Scaling policies for an ASG?

A

1) Dynamic scaling policies
2) Predictive scaling policies

34
Q

What are the three types of Dynamic Scaling Policies for an Automatic Scaling ASG?

A

1) Target Tracking Scaling
2) Simple / Step Scaling
3) Schedule Actions

35
Q

What is Target Tracking Scaling for an ASG?

A

Sets an average ASG CPU preference, and is the most simple scaling policy to set up / use

36
Q

What is Simple / Step Scaling for an ASG?

A

Simple / Step scaling utilizes CloudWatch alarms to configure scaling steps.
For example: when a CloudWatch alarm is triggered, then a preset action is performed (like add or subtract a certain amount of EC2s)

37
Q

What are Scheduled Action scaling policies for an ASG?

A

Scheduled Action policies are used to anticipate scaling based on known usage patterns. This proactive scaling helps to scale during desired time windows
For example: People come to your site to stream the new show every Friday at 5 pm, so you preset EC2 scaling.

38
Q

What are four (4) good metrics to base your ASG scaling on?

A

1) CPU utilization: average CPU usage across instances
2) Request count per target: ensures number of requests per EC2 instances is stable
3) Average in / out operations: for network bound apps
4) Custom metrics pushed using CloudWatch

39
Q

What is Manual Scaling for an ASG?

A

Manual Scaling for an ASG is when you specify maximum and minimum ASG capacity

40
Q

What is an ASG Scaling Cooldown period and why is it beneficial?

A

An ASG scaling cooldown period is a default 300 second waiting period that prevents ASGs from launching or terminating additional instances before the effects of previous activities are visible.

41
Q

What is the default ASG Termination Policy?

A

The default termination policy finds the AZ which has the most instances.
If there are are multiple instances in the AZ to choose from, it will delete the one with the oldest launch configuration

42
Q

By default, how do ASGs manage EC2 instances in an Az?

A

By default, ASGs try to balance the number of instances across an AZ