ELB and ASG

Definition & Interview Answers for AWS Elastic Load Balancer (ELB)

1. What is AWS ELB?

AWS Elastic Load Balancer (ELB) is a managed service that automatically distributes incoming traffic across multiple targets (EC2 instances, containers, IPs, or Lambda functions) to improve availability, scalability, and fault tolerance of applications.

💡 Example Answer: "AWS ELB is a load balancing service that distributes incoming traffic across multiple backend instances to ensure high availability and fault tolerance. It supports different types of load balancers, including ALB, NLB, and CLB, each designed for specific workloads."


2. Types of AWS Elastic Load Balancers (ELB) & Differences

Load Balancer
Purpose
Key Features
Use Cases

Application Load Balancer (ALB)

Layer 7 (HTTP/HTTPS)

Path-based routing, host-based routing, WebSockets, SSL termination

Web applications, microservices, API Gateway alternative

Network Load Balancer (NLB)

Layer 4 (TCP/UDP/TLS)

High performance, low latency, static IPs, handles millions of requests per second

High-throughput applications, gaming, real-time streaming

Classic Load Balancer (CLB) (Legacy)

Layer 4 & 7

Basic HTTP, HTTPS, and TCP routing, sticky sessions

Older applications, basic load balancing needs

Gateway Load Balancer (GWLB)

Layer 3

Deploy third-party security appliances (firewalls, IPS/IDS)

Security & traffic inspection, firewall management


3. ELB Limits & Quotas

Feature
Limit

Max Listeners per Load Balancer

50

Max Targets per Target Group

1,000

Max Rules per ALB

100

Idle Timeout

60 seconds (default, can be adjusted)

Max Load Balancers per AWS Account

50 (can request increase)


4. When to Use Each ELB Type?

Scenario
Best ELB Type
Reason

Load balancing HTTP/HTTPS traffic for microservices

ALB

Supports path-based & host-based routing

Handling millions of connections with low latency

NLB

Optimized for high throughput and TCP/UDP traffic

Basic legacy load balancing needs

CLB

Suitable for old applications (not recommended for new deployments)

Security & traffic inspection with third-party appliances

GWLB

Used for firewalling and packet filtering


5. Common AWS ELB Interview Questions

Q1: What is the difference between ALB and NLB?

💡 Answer: "ALB operates at Layer 7 and is optimized for web applications, supporting advanced routing features like path-based and host-based routing. NLB operates at Layer 4 and is designed for ultra-low latency applications, supporting static IPs and TCP/UDP traffic handling."

Q2: How does AWS ELB perform health checks?

💡 Answer: "ELB performs periodic health checks on registered targets (EC2 instances, containers) to ensure they are healthy. If a target fails health checks, ELB automatically stops routing traffic to it until it recovers."

Q3: Can AWS ELB distribute traffic across multiple AWS regions?

💡 Answer: "No, AWS ELB operates within a single AWS region. For global load balancing, AWS Route 53 is used with latency-based routing or geolocation-based routing."

Q4: What are the differences between a target group and a listener in ELB?

Feature
Description

Target Group

Defines backend instances (EC2, containers, Lambda) that receive traffic

Listener

Checks for incoming client requests and routes them based on rules

Q5: How does SSL termination work in AWS ELB?

💡 Answer: "AWS ELB (ALB/NLB) can offload SSL termination by handling SSL/TLS decryption at the load balancer level, reducing the burden on backend servers. This improves performance and simplifies certificate management using AWS Certificate Manager (ACM)."

Q6: How do you configure sticky sessions in AWS ELB?

💡 Answer: "Sticky sessions, also called session affinity, allow requests from a specific client to be consistently routed to the same backend instance. In ALB, this is done using application cookies, while CLB uses generated session cookies."

Q7: How can AWS Lambda be integrated with AWS ELB?

💡 Answer: "AWS ALB supports Lambda functions as a backend target. This allows you to run serverless applications behind an ELB without provisioning EC2 instances."

Q8: How does an ELB handle sudden traffic spikes?

💡 Answer: "AWS ELB scales automatically based on demand. If a traffic surge occurs, ELB increases its capacity dynamically. However, for rapid scaling, pre-warming ELB by contacting AWS Support can help handle sudden bursts."


Would you like more scenario-based ELB questions for interviews? 🚀

Last updated