Load Balancing Flashcards
What is vertical scalability?
Scale by increasing existing resources of a system
i.e: add cpu and memory to a vm.
What is horizontal scalability?
Scale by adding more infrastructure
i.e: add more servers to existing infrastructure.
What do you need to spread your resources across to achieve high availability in AWS?
You need to build your infrastructure acreoss Multiple AZs (which are made of 1 or more datacenters each).
Or in extreme cases across Multiple Regions.
What is passive HA?
It’s the same as Active-Passive HA
What is active HA?
It’s the same as Active-Active HA
Who manages the elastic load balancer?
AWS manages and ensures it will be always working
What is elastic load balancer?
A service that routes incoming traffic to different destinations depending on pre-specified sets of rules.
What are health checks in ELB?
The load balancer checks if the targets are up, and with that in mind decides to send or not send traffic to those targets.
How does the ELB do its health checks?
The health checks are either HTTP, HTTPS, or TCP.
With a protocol, a port, and a route (i.e: https protocol, checking the /health URL of the app) it checks the health of a web app for example. If the returned code is not an OK response, it declares the instance unhealthy. (The ok response is usually the 200 code for HTTP/HTTPS)
What are the kinds of ELB load balancers?
1 -Classic Load Balancer (CLB)
2 -Application Load Balancer (ALB)
3 -Network Load Balancer (NLB)
4 -Gateway Load Balancer (GLB)
The CLB still works but is not recommended by aws and is deprecated.
Which protocols is ELB ALB compatible with?
Application load balacer supports HTTP, HTTPS and Websocket protocols
Which protocols is ELB NLB compatible with?
TCP, TLS, SSL, and UDP protocols.
Which protocols is ELB GLB compatible with?
It operates directly at layer 3 (With IP Protocol).
What does the ALB balance?
Incoming HTTP/HTTPS traffic
What does the ALB balance between?
Between Target Groups. These could be comprised of EC2 instances, ECS (kubernetes), lambda functions, and directly IP Addresses
What kinds of balancing (routing) does ALB support
1) Based on the URL path, for example: abc.com/users towards a target group, and abc.com/posts towards a different target group.
2) Based on the URL hostname, for example: one.ex.com & other.ex.com
3) Based on a query, for example ex.com/users?id=123 or id?124.
What is a redirect ALB can do?
It can redirect HTTP traffic to HTTPS.
What are target groups in ALB?
The target groups are what ALB balances between. For example a target group could be a set of EC2 instances.
What are good ALB use cases?
Micro services, containerized applications like docker and amazon ECS, Web applications.
Whats the difference between Internal and internet facing in ELB?
Internal has no public IP. It routes requests from clients to targets only using source private ip addresses.
Internet facing routes requests from clients over the internet, to targets.
(This is related to the incoming request traffic).
What is a ELB Listener?
A listener is what checks for connection requests using the port and protocol you configure. The rules that you define for a listener determine how the load balancer routes requests to its registered targets.
What service are the terms listeners, clients, and targets related to? And define each of the terms
Elastic Load Balancer.
The load balancers listeners listen to requests from the clients to access a load balancing target or target group.
How does Network configuration work in ELB?
What is it for?
First you have to choose a VPC. Then you choose at least 1 or more AZs within the region you are configuring under, and a subnet for each AZ.
This is for defining which AZs the targets the load balancer routes traffic to are in.
How do security groups work with ELB?
A security group is attached to the load balancer, and its what controlls the allowed incoming traffic to the load balancer and its listeners.
GLB doesnt use SG cause it redirects packets directly.
What does an ALB need to have configured to be able to receive the HTTP traffic?
An SG with an inbound rule for HTTP (Or HTTPS)
What does an ALB need to have configured to be able to ROUTE the HTTP traffic?
To route the traffic, it need a configured listener and target group with healthy targets.
To which types of ELB do security groups apply?
ALB and NLB
What is the difference between ALB, NLB, and GLB?
The ALB listens to HTTP/HTTPS or websocket requests. The NLB listents to TCP/UDP or TLS requests, this could be any TCP/UDP port you specify. The GLB works with IP protocol.
Each has its advantages and ideal use cases.
ALB: The ALB works in layer 7, at the request level. This means it can route the connection requests based on information at the HTTP/HTTPS level. For example, it supports path-based routing. This means that it uses the path of the http url to determine where to route the connection to. It also supports host based routing, meaning that it can check the domain of the URL and use it to route to different target groups. The same for the query string parameters, and source ip.
NLB: NLB operates directly at Layer 4.
GLB: GLB is used for directing traffic to Virtual Firewalls, IDS (Intrusion detection systems), IPS (Instrusion Prevention Systems), and deep packed inspection systems. It acts as a gateway and directs traffic to instances with these scurity virtual appliances, then directs traffic to the destination target apps, or whatever.
What does an ELB listener do?
Forward requests to a target group
Which options do you have for ALB target groups targets?
Instances
IP Addresses
Lambda functions
Application load balancer
How do ALB Helath Checks work?
The alb tries to connect via HTTP or HTTPS to the specified path, for example /health, or just / which is the root path.
How do ALB listeners work?
The listener is configured with a target group, which can be of many kinds. And after that, the listener forwards the HTTP/HTTPS requests to the targets that are active.
What are listener rules, conditions and actions in ALB?
Listener rules are what decide how the listener routes the traffic. You create them in each listener.
Listener rules have conditions and actions.
Actions are what the listener decides to do after a condition is true.
It can forward to a specific target group, redirect to a different site, or return a specific response code, like 404 not found, etc.
Conditions are for example if the request is coming from a specific ip or range, if it is for a specific header like “header.example.com”, if the request is for a specific path of the application like “example.com/specificpath”, specific query strings, etc.
Rules also have priorities, you set a number for each rule that sets their priority order. Higher priority rules apply first.
Can a listener have multiple target groups?
YES
What layer does NLB work on?
Layer 4 (TCP & UDP traffic)
What is NLB better than ALB at?
Handling millions of requests per second
Latency. Has lower latency, aprox 100ms to 400 in the alb.
Can NLB route traffic to target public ip addresses?
No, only private ip addresses.
Neither can ALB or GLB.
Can route to onpremises when using vpn or direct connect
What is an elastic ip?
A static public ip address. Up to 3 per aws account unless you talk to aws.
Can NLB only route to AWS ip addresses?
FALSE. You can load balance between aws ips and on premises ips.
You can build a hybrid target group and load balance in a hybrid mode.
How can you combine usage of a NLB and ALB?
You can put a NLB on top of a ALB. You could do this to get the fixed ip addresses with the NLB, and then with the ALB you can get all the rules for handling http traffic.
Which ELB has the option of using an Elastic IP?
The network load balancer.
Its the only one that supports using an elastic ip. Meaning a static ip.
What kind of sg would you create for a load balancer that is internet facing?
A sg with inbound HTTP or HTTPS traffic allowed.