High Availability & Scalability Flashcards

1
Q

What is scalability

A

The ability of a system / application to adapt to handle greater loads

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

Name the 2 ways a system / application can scale

A

Vertical and Horizontal Scaling

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

Characteristics of vertical scaling

A

increase the size of an instance
e.g. t1.micro to t1.large

common for non-distributed systems like a database
e.g. RDS, Elasticache are services that scale vertically

limited scalability

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

Characteristics of horizontal scalability

A

increase number of instances / systems for an application
common for distributed systems such as web / modern applications

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

It is usually easy to scale vertically than horizontally. true or false?

A

False
Horizontal scalability is easy thanks to the cloud offerings such as Amazon EC2 ASG, ALB multi AZ

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

Characteristics of High Availability

A

application / system is running in at least 2 AZs

survives a data center loss

HA can be passive (e.g. RDS Multi AZ)

HA can be active (e.g. horizontal scaling)

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

What are load balancers?

A

Load balancers are systems that forward traffic to multiple servers downstream

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

Purpose & Characteristics of load balancers

A
  • Spread load across multiple downstream instances
  • expose single point of access (DNS) to your application/system
  • seamlessly handle failures of downstream systems
  • perform health checks
  • provide SSL termination
  • enforce session stickiness
  • HA across zones
  • separate public vs private traffic
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is ELB

A

Elastic Load Balancer is a managed Load Balancer
- AWS guarantees that it will be working
- AWS takes care of upgrades, maintenance, and high availability
- AWS provides few configuration knobs
- costs less to set up own LB but takes lot more effort

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

Advantages of ELB

A

Due to integrations to many AWS offerings/services
- EC2 ASG, ECS
- ACM
- Cloudwatch
- Route 53
- WAF
- Global Accelerator

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

What are health checks? (HC)

A

A mechanism for LBs to be aware of instances it can forward traffic to
a HC is done on a port and a route (/health)
if response is not 200, then instances is unhealthy

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

Types of LBs

A

CLB, ALB, NLB, GLB

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

What OSI layer does ALB operate at?

A

Layer 7

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

What OSI layer does NLB operate at?

A

Layer 4

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

What OSI layer does GLB operate at?

A

Layer 3

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

What protocols does OSI layer 7 support?

A

http, https, ws

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

What protocols does OSI layer 4 support?

A

tcp, tls, udp

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

What protocol does OSI layer 3 support?

A

IP

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

What mechanism does the LB rely on to restrict traffic from the internet accessing an EC2 instance?

A

Security Group

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

The BFF design pattern can be implemented in AWS using what mechanism?

A

AWS has a feature called Target Group where a group of EC2 instances can be grouped together. A LB can divert traffic, e.g. based on path, to a particular TG. It can also divert traffic to another TG

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

ALB can route to multiple target groups. True or False?

A

True

22
Q

Health Checks are implemented at a TG level. True to False?

A

True

23
Q

What patterns does a LB support before making a decision to divert traffic to a particular TG?

A

Query String/Parameter, IP

24
Q

Characteristics of an NLB

A

Layer 4 LB
Forwards TCP & UDP traffic
Millions of requests per second
low latency

25
Q

NLB has 1 static IP per AZ. True or False?

A

True

26
Q

NLB does not support assigning Elastic IP. True or False

A

False

27
Q

Characteristics of NLB - Target Groups

A

EC2 instances
IP Addresses must be private
ALB (can be forwarded to an ALB)

28
Q

Characteristics of a GLB

A

A Gateway Load Balancer can be used to deploy, scale and manage a fleet of 3rd party network virtual appliances in AWS
e.g. Firewalls, Intrusion Detection

29
Q

Scaling an EC2 instance from r4.large to r4.4xlarge is called what type of scalability?

A

Vertical Scalability

30
Q

Running an application on an Auto Scaling Group that scales the number of EC2 instances in and out is called what?

A

Horizontal Scalability

31
Q

Elastic Load Balancers provides a ..

a) Static IPv4 we can use in our application

b) Static DNS name we can use in our application

c) Static IPv6 we can use in our application

A

B)

Only Network Load Balancer provides both static DNS name and static IP. While, Application Load Balancer provides a static DNS name but it does NOT provide a static IP. The reason being that AWS wants your Elastic Load Balancer to be accessible using a static endpoint, even if the underlying infrastructure that AWS manages changes.

32
Q

You are running a website on 10 EC2 instances fronted by an Elastic Load Balancer. Your users are complaining about the fact that the website always asks them to re-authenticate when they are moving between website pages. You are puzzled because it’s working just fine on your machine and in the Dev environment with 1 EC2 instance. What could be the reason?

a) Your website must have an issue when hosted on multiple EC2 instances

b) The EC2 instances log out users as they can’t see their IP addresses, instead, they receive ELB IP addresses

c) The ELB does not have Sticky Sessions enabled

A

C)

ELB Sticky Session feature ensures traffic for the same client is always redirected to the same target (e.g., EC2 instance). This helps that the client does not lose his session data.

33
Q

You are using an Application Load Balancer to distribute traffic to your website hosted on EC2 instances. It turns out that your website only sees traffic coming from private IPv4 addresses which are in fact your Application Load Balancer’s IP addresses. What should you do to get the IP address of clients connected to your website?

a) Modify your website’s frontend so that users send their IP in every request

b) Modify your website’s backend to get the client IP address from the X-Forwarded-For header

c) Modify your website’s backend to get the client IP address from the X-Forwarded-Port header

d) Modify your website’s backend to get the client IP address from the X-Forwarded-Proto header

A

B)

When using an Application Load Balancer to distribute traffic to your EC2 instances, the IP address you’ll receive requests from will be the ALB’s private IP addresses. To get the client’s IP address, ALB adds an additional header called “X-Forwarded-For” contains the client’s IP address.

34
Q

You hosted an application on a set of EC2 instances fronted by an Elastic Load Balancer. A week later, users begin complaining that sometimes the application just doesn’t work. You investigate the issue and found that some EC2 instances crash from time to time. What should you do to protect users from connecting to the EC2 instances that are crashing?

a) Enable ELB health checks

b) Enable ELB Stickiness

c) Enable SSL termination

d) Enable Cross-Zone Load Balancing

A

A)

When you enable ELB Health Checks, your ELB won’t send traffic to unhealthy (crashed) EC2 instances.

35
Q

You are working as a Solutions Architect for a company and you are required to design an architecture for a high-performance, low-latency application that will receive millions of requests per second. Which type of Elastic Load Balancer should you choose?

a) Application Load Balancer

b) Classic Load Balancer

c) Network Load Balancer

A

C)

Network Load Balancer provides the highest performance and lowest latency if your application needs it.

36
Q

Application Load Balancers support the following protocols, EXCEPT:

a) HTTP

b) HTTPS

c) TCP

d) Websocket

A

C)

Application Load Balancers support HTTP, HTTPS and WebSocket

37
Q

Application Load Balancers can route traffic to different Target Groups based on the following, EXCEPT:

a) Client’s location (Geography)

b) Hostname

c) Request URL Path

d) Source IP Address

A

A)

ALBs can route traffic to different Target Groups based on URL Path, Hostname, HTTP Headers, and Query Strings.

38
Q

Registered targets in a Target Groups for an Application Load Balancer can be one of the following, EXCEPT:

a) EC2 Instances

b) Network Load Balancer

c) Private IP Addresses

d) Lambda Functions

A

B)

39
Q

For compliance purposes, you would like to expose a fixed static IP address to your end-users so that they can write firewall rules that will be stable and approved by regulators. What type of Elastic Load Balancer would you choose?

a) Application Load Balancer with an Elastic IP attached to it

b) Network Load Balancer

c) Classic Load Balancer

A

B)

Network Load Balancer has one static IP address per AZ and you can attach an Elastic IP address to it. Application Load Balancers and Classic Load Balancers have a static DNS name.

40
Q

You want to create a custom application-based cookie in your Application Load Balancer. Which of the following you can use as a cookie name?

a) AWSALBAPP

b) APPUSERC

c) AWSALBTG

d) AWSALB

A

B)

The following cookie names are reserved by the ELB (AWSALB, AWSALBAPP, AWSALBTG).

41
Q

You have a Network Load Balancer that distributes traffic across a set of EC2 instances in us-east-1. You have 2 EC2 instances in us-east-1b AZ and 5 EC2 instances in us-east-1e AZ. You have noticed that the CPU utilization is higher in the EC2 instances in us-east-1b AZ. After more investigation, you noticed that the traffic is equally distributed across the two AZs. How would you solve this problem?

a) Enable Cross-Zone Load Balancing

b) Enable Sticky Sessions

c) Enable ELB Health Checks

d) Enable SSL Termination

A

A)

When Cross-Zone Load Balancing is enabled, ELB distributes traffic evenly across all registered EC2 instances in all AZs.

42
Q

Which feature in both Application Load Balancers and Network Load Balancers allows you to load multiple SSL certificates on one listener?

A) TLS Termination

B) Server Name Indication (SNI)

C) SSL Security Policies

D) Host Headers

A

B)

43
Q

You have an Application Load Balancer that is configured to redirect traffic to 3 Target Groups based on the following hostnames: users.example.com, api.external.example.com, and checkout.example.com. You would like to configure HTTPS for each of these hostnames. How do you configure the ALB to make this work?

A) Use an HTTP to HTTPS redirect rule

B) Use a security group SSL certificate

C) Use Server Name Indication (SNI)

A

C)
Server Name Indication (SNI) allows you to expose multiple HTTPS applications each with its own SSL certificate on the same listener. Read more here: https://aws.amazon.com/blogs/aws/new-application-load-balancer-sni/

44
Q

You have an application hosted on a set of EC2 instances managed by an Auto Scaling Group that you configured both desired and maximum capacity to 3. Also, you have created a CloudWatch Alarm that is configured to scale out your ASG when CPU Utilization reaches 60%. Your application suddenly received huge traffic and is now running at 80% CPU Utilization. What will happen?

A) Nothing

B) The desired capacity will go up to 4 and the maximum capacity will stay at 3

C) The desired capacity will go up to 4 and the maximum capacity will stay at 4

A

A)

The Auto Scaling Group can’t go over the maximum capacity (you configured) during scale-out events.

45
Q

You have an Auto Scaling Group fronted by an Application Load Balancer. You have configured the ASG to use ALB Health Checks, then one EC2 instance has just been reported unhealthy. What will happen to the EC2 instance?

A) The ASG will keep the instance running and re-start the application

B) The ASG will detach the EC2 instance and leave it running

C) The ASG will terminate the EC2 instance

A

C)

You can configure the Auto Scaling Group to determine the EC2 instances’ health based on Application Load Balancer Health Checks instead of EC2 Status Checks (default). When an EC2 instance fails the ALB Health Checks, it is marked unhealthy and will be terminated while the ASG launches a new EC2 instance.

46
Q

Your boss asked you to scale your Auto Scaling Group based on the number of requests per minute your application makes to your database. What should you do?

A) Create a cloud watch custom metric then create a Cloud Watch Alarm on this metric to scale your ASG

B) You politely tell him its impossible

C) Enable detailed monitoring then create a CloudWatch Alarm to scale your ASG

A

A)

There’s no CloudWatch Metric for “requests per minute” for backend-to-database connections. You need to create a CloudWatch Custom Metric, then create a CloudWatch Alarm.

47
Q

An application is deployed with an Application Load Balancer and an Auto Scaling Group. Currently, you manually scale the ASG and you would like to define a Scaling Policy that will ensure the average number of connections to your EC2 instances is around 1000. Which Scaling Policy should you use?

A) Simple Scaling Policy

B) Step Scaling Policy

C) Target Tracking Policy

D) Scheduled Scaling Policy

A

C)

48
Q

You have an ASG and a Network Load Balancer. The application on your ASG supports the HTTP protocol and is integrated with the Load Balancer health checks. You are currently using the TCP health checks. You would like to migrate to using HTTP health checks, what do you do?

A) Migrate to an ALB

B) Migrate the health check to HTTP

A

A)

the NLB supports HTTP health checks as well as TCP and HTTPS

49
Q

You have a website hosted in EC2 instances in an Auto Scaling Group fronted by an Application Load Balancer. Currently, the website is served over HTTP, and you have been tasked to configure it to use HTTPS. You have created a certificate in ACM and attached it to the Application Load Balancer. What you can do to force users to access the website using HTTPS instead of HTTP?

a) Send an email to all customers to use HTTPS instead of HTTP

b) Configure the ALB to redirect HTTP to HTTPS

c) Configure the DNS record to redirect HTTP to HTTPS

A

B)

50
Q

In an ASG scaling activity what is the default value for a cool down period?

A

300 seconds -> 5 minutes
During the cool down period, the ASG will not launch or terminate additional instances to allow for metrics to stabilize

51
Q

What strategy can be used to reduce the cooldown periods and serve requests faster?

A

Use a ready-to-use AMI to reduce configuration time