High Availability Architecture Flashcards

1
Q

What is a load balancer and what are the three types?

A
  • A physical or virtual device that helps to balance multiple web servers
    1. Application load balancer: best suited for load balancing HTTP and HTTPS traffic. Operate at Layer 7 and are application-aware. They are intelligent: can create advanced request routing.
    2. Network load balancers: best suited for load balancing TCP traffic where extreme performance is required. Operating at layer 4 (connect level), they are capable of handling millions of requests per second, with low latencies
    3. Classic load balancers: legacy ELBs. You can load balance HTTP(S) applications at layer 7, such as X-Forwarded-For and stick sessions. Can also use strict Layer 4 for apps that rely on TCP protocol
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Errors in Load Balancing

A
  • For classic load balancers, when an application stops responding, the ELB responds with a 504 error. This means the app is having issues, such as web server or database issues
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

X-Forwarded-For

A
  • A load balancer will mask the IP address of external traffic from the application itself, which will only see the IP address of the load balancer.
  • If we want the application to see the external IP address (e.g. to identify users from a particular country), then we need X-Forwarded-For header
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Sticky Sessions

A
  • Classic load balancers routes each request independently to the registered EC2 instance with the smallest load
  • Sticky sessions allows you to bind a user’s session to a specific EC2 instance. This ensure that all request from the user during the session are sent to the same instance
  • You can enable Sticky Sessions for Application Load Balancers as well, but the traffic will be sent at the Target Group Level
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Cross Zone load balancing

A
  • Enables load balancers to share the traffic load between AZs
  • Otherwise, if we have a load balancer in each AZ that doesn’t enable cross zone balancing, and one AZ has more EC2 instances that the other, the AZ with the least EC2 instances will have to work harder
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Path Patterns

A
  • You can create a listener with rules to forward requests based on the URL path. This is known as path-based routing
  • If you are running microservices, you can route traffic to multiple back-end services using path-based routing
  • For example, you can route general requests to one target group and requests to render images to another target group
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Auto Scaling Theory (3 components)

A
  1. Groups: logical component. Web Server group or Application group or Database group etc.
  2. Configuration Templates: Groups use a launch template or a launch config as a config template for its EC2 instances. You can specify information such as the AMI ID, instance type, key pair, security groups, and block device mapping for your instances
  3. Scaling Options: provide several ways for you to scale your Auto Scaling groups. E.g. you can configure a group to scale based on the occurrence of specified conditions (dynamic scaling) or on a schedule.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

5 types of scaling options

A
  1. Maintain current instance levels at all times
  2. Scale manually
  3. Scale based on a schedule
  4. Scaling on demand
  5. Predictive scaling
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Scaling options: 1: maintain current instance levels at all times

A
  • Can configure Auto Scaling group to maintain a specified number of running instances at all times
  • To maintain the current instance levels, EC2 Auto Scaling performs a periodic health check on running instances with an Auto Scaling Group
  • When EC2 Auto Scaling finds an unhealthy instance, it terminates that instances and launches a new one
How well did you know this?
1
Not at all
2
3
4
5
Perfectly