AWS: Fundamentals Flashcards

1
Q

What is the difference between horizontal and vertical scaling?

A

Vertical scaling (“Scaling up”) means moving your app to a server with more size/power than your current app server. In EC2 terms, this would mean increasing the size of an instance e.g. t2.micro to t2.large.

Horizontal scaling (“Scaling out”) means adding more servers to your existing pool of resources duplicating the app. Performance improvements are found because load is now distributed amongst more servers. In EC2 terms, this would mean setting up more app servers.

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

What is a load balancer?

A

A server that forwards internet traffic to multiple downstream servers.

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

What types of load balancer does AWS offer?

A
  1. Classic Load Balancer
  2. Application Load Balancer
  3. Network Load Balancer
  4. Gateway Load Balancer
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What kind of traffic is supported with Classic Load Balancers?

A

TCP (layer 4)

HTTP & HTTPS (layer 7)

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

What kind of traffic is supported with Application Load Balancers?

A

HTTP & HTTPS & Websockets (layer 7) only

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

What kind of traffic is supported with Network Load Balancers?

A

UDP & TCP traffic

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

What features are present on the CLB, the ALB and the NLB? What do they have in common?

A
  1. Spread load across multiple downstream targets
  2. Implement health checks of downstream targets
  3. Highly available (comprised of multiple instances managed by AWS) and elastic
  4. TLS Termination (Decrypt SSL/TLS traffic before sending on to servers reducing load and saving the uploading of SSL certs on every machine)
  5. Can be internet facing or internal, separating public traffic from private traffic
  6. Export useful metrics to CloudWatch
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Whatever the ELB, you must always configure at least one listener. What is a listener?

A

The listener defines how your inbound connections are routed to your downstream target groups (e.g. fleet of EC2 instances).
It will listen for traffic based on a given port and protocol that you configure.

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

What is a target group?

A

A group of resources that your want your ELB to route requests to.

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

Most of the ELBs are configured so that you register targets in target groups, and route traffic to the target groups.

Which ELB is different and how does it register targets?

A

Classic Load Balancer

CLB registers instances with the load balancer. There are no target groups defined.

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

Which ELB(s) can route to many ports on the same target?

A

Application Load Balancer

Network Load Balancer

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

Which ELB(s) supports routing to targets outside AWS?

A

Application Load Balancer

Network Load Balancer

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

Which ELB(s) can be used in EC2-Classic?

A

Classic Load Balancer

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

Which ELB(s) preserves the source IP?

A

Network Load Balancer.

NLB preserves the source IP address in TCP/UDP packets.

Whereas the ALB and ELB sends its own IP address to downstream targets.

Application Load Balancers and Classic Load Balancers automatically add X-Forwarded-For, X-Forwarded-Proto, and X-Forwarded-Port headers to the request. The X-Forwarded-For contains information about the client ip address. The X-Forwarded-Proto request header helps you identify the protocol (HTTP or HTTPS) that a client used. The X-Forwarded-Port request header helps you identify the destination port that the client used.

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

Which ELB(s) support routing traffic to targets based on the path in the url, the hostname or the query string?

A

Application Load Balancer

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

Which ELB(s) support redirecting requests from one URL to another?

A

Application Load Balancer

You can redirect traffic from http to https, for example

17
Q

Which ELB is best for microservices?

A

Application Load Balancer

With one load balancer you can route to multiple apps on the same EC2 instance (e.g. containers).

18
Q

What types of targets can be in an Application Load Balancer target group?

A
  1. EC2 Instances
  2. IP addresses (You can’t specify publicly routable IP addresses.)
  3. Lambda functions
19
Q

What types of targets can be in a Network Load Balancer target group?

A
  1. EC2 Instances

2. IP addresses (You can’t specify publicly routable IP addresses.)

20
Q

What is the difference between a hostname and an ip address?

A

A IP address is the numeric unique address that identifies devices on a network e.g. 192.0.2.1

A hostname is the name assigned to the device.

DNS servers translate the hostnames into IP addresses.

21
Q

Which ELB(s) provides a static IP address?

A

Network Load Balancer

One static IP address is provided per AZ

22
Q

What is the benefit of having a static IP address for your load balancer?

A

Enabling firewall rules.

For example: Your application collects data from your customers’ networks. Your customer wants to define strict firewall rules that ensures that the traffic leaving their network can only flow to a specific destination. If you have a firewall that CAN create rules based on DNS names (“allow traffic outbound to www.example.com“) then there is no issue but often these firewalls are based on IP addresses.

23
Q

Which ELB is best for a near real time video streaming app?

A

Network Load Balancer

Less latency than a ALB: around 100ms vs 400 ms (ALB) per request

24
Q

What is Session Affinity? (What are sticky sessions?)

A

All requests made by a client are sent to the same instance.

You can use the sticky session feature (also known as session affinity) to enable the load balancer to bind a user’s session to a specific target.

25
Q

Which ELB(s) have the sticky session feature?

A

Application Load Balancer

Classic Load Balancer

26
Q

Cookies are used to implement sticky sessions.
What two types of cookies can be used?

A

Application based cookies

Duration based cookies

27
Q

What is cross zone load balancing?

A

If cross zone load balancing is disabled, it means that load balancers will only distribute load across the instances/resources within their availability zone.

Why is this a problem? You could have a situation where you have instances in multiple AZs but the load isn’t evenly distributed across them.

By enabling cross zone load balancing, traffic is now split evenly across instances no matter the zone.

28
Q

Which ELB has cross zone load balancing enabled by default?

A

Application Load Balancer (cannot change)

29
Q

Which ELB(s) do NOT have cross zone load balancing enabled by default and can be enabled without cost?

A

Classic Load Balancer

The Network Load Balancer’s cross zone load balancing is a paid service.

30
Q

Why would you want to use more than one TLS/SSL with the same ELB?

A

The most common reason you might want to use multiple certificates is to handle different domains with the same load balancer.

31
Q

Which ELB(s) have support for multiple TLS/SSL certificates?

A

Application Load Balancer
Network Load Balancer

The Classic Load Balancer does not support this => you must have multiple CLBs for multiple hostnames.

32
Q

What is SNI?

A

Server Name Indication

It is an extension of the TLS protocol: in a client request, the hostname of the server is specified.

33
Q

How does SNI work?

A

SNI works by having the client tell the server “This is the domain I expect to get a certificate for” when it first connects.

The load balancer is able to pick the required certificate from a list. If the domain is not found, a default certificate is returned.

34
Q

What problem does connection draining solve?

A

Helps graceful shutdown of downstream instance/resource.

When an instance is considered unhealthy and set to be terminated, it’s possible that existing connections will halt abruptly.

35
Q

How does connection draining work?

A

When enabled, a timeout must be specified.
When a resource is being deregistered, the load balancer will not send any new requests to the resource but it will allow existing in-flight requests to complete.
When the timeout is reached any existing connections are forceably closed.

36
Q

What is the term used to describe connection draining when applied to targets groups of ALBs and NLBs?

A

Deregistration Delay