83. Advanced ELB

Sticky Sessions: Classic load balancer routes each request independently to the registered EC2 instance with the smallest load. Sticky session allows users session to bind to a specific EC2 instance. This ensures that all requests from the user during the session are sent to the same EC2 instance. We can enable sticky sessions for Application Load Balancers as well, but the traffic will be sent at the Target Group Level rather than individual EC2 instance.
User trying to visit your website via Classic Load Balancer. Suppose we have two EC2 instances and all the traffic is being sent to only one EC2 instance. Then we have to disable sticky sessions.

No Cross Zone Load Balancing: ELB (Suppose Classic) wont be able to send traffic to another AZ.
Cross Zone Load Balancing: ELB (Suppose Classic) will be able to send traffic to another AZ.
User >> Route 53 >> 100% traffic is being sent to EC2 instances via ELB, which are in one AZ (US-EAST-1A). 0% traffic is being sent to another EC2 instances via ELB, which are in another AZ (US-EAST-1B). We should enable Cross Zone Load Balancing for traffic to flow to second EC2 instance.

Path Patterns: We can create a listener with rules to forward requests based on the URL path. This is known as path-based routing. If we are running microservices, we can route traffic to multiple back-end services using path-based routing. For example, we can route general requests to one target group and requests to render images to another target group.
User >> Route 53 >> 100% traffic is being sent to EC2 instances via ELB (Application Load Balancer as its reading URL path), which are in one AZ (US-EAST-1A) to access www.myurl.com. In order to access images (www.myurl.com/images/) in another AZ (US-EAST-1B), we need to enable ‘Path Patterns’.

Tips:
i) Sticky Sessions enable users to stick to the same EC2 instance. Can be useful if you are storing information locally to that instance.
ii) Cross Zone Load Balancing enables to load balance across multiple AZs
iii) Path Patterns allow to direct traffic to different EC2 instances based on the URL contained in the request.

Questions:
i. What enables load balancing between multiple applications per load balancer?
A. listeners
B. sticky sessions
C. path-based routing
D. backend server authentication
Answer (C)