Load balancing concepts (for example, Application Load Balancer)

Task Statement 2.2: Design highly available and/or fault-tolerant architectures.

📘AWS Certified Solutions Architect – (SAA-C03)


1. What is Load Balancing?

Load balancing is the process of distributing incoming network traffic across multiple servers (resources) so that:

  • No single server is overloaded
  • Applications remain highly available
  • Performance is consistent
  • Failures do not impact users

In AWS:

Load balancing is provided by Elastic Load Balancing (ELB).


2. Why Load Balancing is Important

Load balancing is essential for:

1. High Availability

  • Traffic is spread across multiple servers (often in different Availability Zones)
  • If one server or AZ fails, others continue serving traffic

2. Fault Tolerance

  • Unhealthy servers are automatically removed
  • Traffic is routed only to healthy targets

3. Scalability

  • Works with Auto Scaling Groups
  • Automatically adjusts as traffic increases or decreases

4. Better Performance

  • Prevents overload on individual instances
  • Improves response time

3. Types of AWS Load Balancers

AWS provides 4 types of load balancers:

1. Application Load Balancer (ALB)

  • Works at Layer 7 (HTTP/HTTPS)
  • Best for web applications
  • Supports advanced routing

2. Network Load Balancer (NLB)

  • Works at Layer 4 (TCP/UDP)
  • Ultra-high performance, low latency

3. Gateway Load Balancer (GWLB)

  • Used for security appliances
  • Works with firewalls and inspection systems

4. Classic Load Balancer (CLB)

  • Legacy (not recommended for new architectures)

👉 For the SAA-C03 exam, ALB is the most important.


4. Application Load Balancer (ALB) – Deep Dive

4.1 What is ALB?

Application Load Balancer (ALB) distributes HTTP/HTTPS traffic based on content of the request.

It can make routing decisions based on:

  • URL path
  • Hostname
  • Headers
  • Query strings

4.2 Key Features of ALB

1. Layer 7 Routing (Content-Based Routing)

ALB can route traffic based on request details.

Examples (IT-focused):

  • /api/* → Backend API servers
  • /images/* → Image processing servers
  • admin.example.com → Admin application

2. Target Groups

ALB does not send traffic directly to instances. Instead, it sends traffic to Target Groups.

A target group contains:

  • EC2 instances
  • ECS containers
  • IP addresses
  • Lambda functions

👉 Each target group is associated with:

  • Health checks
  • Routing rules

3. Listeners

A listener checks for incoming traffic.

  • Defined by protocol + port
    • HTTP : 80
    • HTTPS : 443

Each listener has rules to route traffic.


4. Listener Rules

Rules define how traffic is routed.

Each rule has:

  • Condition (e.g., path, host)
  • Action (forward to target group)

👉 Rules are evaluated in order (priority-based).


5. Health Checks

ALB continuously checks whether targets are healthy.

  • If a target fails → it is removed from routing
  • If it recovers → it is added back

Health checks use:

  • HTTP/HTTPS endpoints
  • Example: /health

6. Multi-AZ Support

ALB automatically distributes traffic across:

  • Multiple Availability Zones

👉 This ensures:

  • High availability
  • Fault tolerance

7. Integration with Auto Scaling

ALB works with Auto Scaling Groups (ASG):

  • New instances → automatically registered
  • Terminated instances → automatically removed

8. SSL/TLS Termination

ALB can handle HTTPS:

  • Stores SSL certificates (via AWS Certificate Manager)
  • Decrypts traffic before forwarding

👉 This reduces load on backend servers


9. WebSocket and HTTP/2 Support

  • Supports modern web applications
  • Useful for real-time communication systems

10. Sticky Sessions (Session Affinity)

  • Ensures a user is sent to the same backend server
  • Uses cookies

👉 Useful for applications that store session data locally


5. How ALB Works (Step-by-Step Flow)

  1. User sends request to ALB DNS name
  2. Listener receives request (HTTP/HTTPS)
  3. Listener evaluates rules
  4. Request is forwarded to a target group
  5. ALB selects a healthy target
  6. Target processes request and responds

6. ALB vs NLB (Exam Comparison)

FeatureALBNLB
LayerLayer 7Layer 4
ProtocolsHTTP/HTTPSTCP/UDP
RoutingContent-basedIP/port-based
PerformanceModerateVery high
Use caseWeb appsHigh-performance apps

👉 Exam tip:

  • If question mentions HTTP routing or URL-based routing → ALB
  • If question mentions ultra-low latency or TCP → NLB

7. Important Concepts for the Exam

7.1 Cross-Zone Load Balancing

  • ALB distributes traffic evenly across all targets in all AZs
  • Enabled by default

7.2 Idle Timeout

  • Time ALB waits before closing inactive connection

7.3 Deregistration Delay

  • Time given to complete in-flight requests before removing a target

7.4 Security

ALB uses:

  • Security Groups (unlike NLB)
  • Can restrict:
    • Source IP
    • Ports

8. Common Architecture Patterns (Exam-Focused)

1. ALB + Auto Scaling

  • Dynamic scaling
  • High availability

2. ALB + ECS (Containers)

  • Microservices architecture
  • Each service → different target group

3. ALB + Lambda

  • Serverless backend
  • Event-driven processing

9. When to Use ALB (Exam Clues)

Choose ALB when you see:

  • HTTP/HTTPS workloads
  • Microservices architecture
  • Path-based routing
  • Host-based routing
  • Web applications
  • Need for WebSockets or HTTP/2

10. When NOT to Use ALB

Avoid ALB when:

  • Need ultra-low latency → use NLB
  • Need static IP → use NLB
  • Non-HTTP protocols → use NLB

11. Common Exam Traps

Trap 1:

“Route based on URL path”
→ Correct answer: ALB


Trap 2:

“Handle millions of requests per second with low latency”
→ Correct answer: NLB


Trap 3:

“Use Lambda as target”
→ Only supported by ALB


Trap 4:

“Need security group on load balancer”
→ Only ALB supports this (NLB does not)


12. Quick Summary (Revision)

  • Load balancing distributes traffic across servers
  • AWS uses Elastic Load Balancing (ELB)
  • ALB = Layer 7, HTTP/HTTPS, smart routing
  • Key components:
    • Listener
    • Rules
    • Target Groups
  • Supports:
    • Path-based routing
    • Host-based routing
    • Health checks
    • Auto Scaling integration
  • Default choice for web applications
Buy Me a Coffee