AWS Certified Cloud Practitioner / ELB & ASG - Elastic Load Balancing & Auto Scaling Groups

Elastic Load Balancing (ELB) Overview

⚖️ What Is a Load Balancer?

A load balancer sits in front of your application. It receives incoming traffic and spreads it across multiple backend servers instead of sending everything to one place.

🌍 Users  →  ⚖️ Load Balancer  →  💻 EC2 Instances (Backend)

✅ Result: no single server gets overwhelmed. Traffic is spread evenly, which improves both performance and scalability.


🧐 Why Use One?

🎯 Core benefits

  • ⚖️ Spreads traffic across multiple EC2 instances

  • 🌐 Gives users one single access point (a DNS name), even though many servers sit behind it

  • 🛡️ Detects failures automatically and stops sending traffic to unhealthy instances

  • ❤️ Runs regular health checks on each instance

  • 🔒 Can handle HTTPS decryption for you (SSL termination)

  • 🌍 Can span multiple Availability Zones, so an entire AZ going down doesn't take your app with it

🧠 The core idea

  • Without a load balancer: one server = one bottleneck ❌, and one point of failure.

  • With a load balancer: many servers share the load = a scalable, resilient system ✅.


🧮 It's a Managed Service

An AWS Elastic Load Balancer (ELB) is fully managed by AWS:

  • ✅ AWS guarantees it keeps running

  • 🔧 AWS handles upgrades, patching, and high availability behind the scenes

  • 🎛️ You only get a limited set of configuration options — by design, so there's less for you to manage

💡 You could build and run your own load balancer on EC2. It would be cheaper to set up, but you'd be responsible for all the maintenance and integration work yourself. For most use cases, ELB is easier and safer.

🚨 Exam framing: AWS ELB is the preferred answer over "build it yourself," unless the question specifically calls for a custom setup


⚖️ Types of Load Balancers

A. Application Load Balancer (ALB) — Layer 7

Works at the HTTP/HTTPS level, so it understands the content of requests, not just the packets.

✨ Features

  • 🌐 Supports HTTP, HTTPS, and gRPC

  • 🧭 Advanced routing based on the request itself:

    • Path-based (e.g. /api vs /images)

    • Host-based (different domains routed differently)

🎯 Best for: web applications, microservices — anywhere routing decisions depend on the request content.

B. Network Load Balancer (NLB) — Layer 4

Works at the TCP/UDP level. It doesn't inspect request content — it just moves packets, extremely fast.

✨ Features

  • 🚀 Very high performance, capable of handling millions of requests per second

  • 📍 Provides a static IP (via Elastic IP) — useful when clients need a fixed address to connect to

🎯 Best for: real-time systems, gaming 🎮, financial apps 💹 — anywhere raw speed and low latency matter most.

C. Gateway Load Balancer (GWLB) — Layer 3

Designed to route traffic through third-party security appliances before it reaches your app.

🔍 What it does

  • 🔥 Firewalling

  • 🚨 Intrusion detection

  • 🧬 Deep packet inspection

📊 How it works

🌍 User → GWLB → 🔥 Firewall (EC2) → GWLB → 💻 Application

Traffic is inspected before it's allowed to reach your application. GWLB uses the GENEVE protocol to pass traffic to and from these security appliances.

✅ Exam keyword: security, firewall, packet inspection

D. Classic Load Balancer (CLB) — Deprecated

  • ❌ Legacy load balancer, officially retired in 2023

  • Mixed Layer 4 and Layer 7 behavior in one product

  • Replaced by ALB 🟦 and NLB 🟥 — you won't need to set one up today, but it may still show up in exam questions as the "old" option


🤝 Quick Comparison

Feature

🟦 ALB

🟥 NLB

🟩 GWLB

OSI Layer

7

4

3

Protocols

HTTP / HTTPS / gRPC 🌐

TCP / UDP ⚡

IP (GENEVE) 🧬

Performance

High

Ultra-high 🚀

High

Static IP

❌

✅

❌

Best for

Web apps, microservices

High-performance, low-latency apps

Security appliances (firewalls, IDS)



❓ How Load Balancers Enable Elasticity

A load balancer becomes really powerful when paired with an Auto Scaling Group ⚙️:

  • 📈 As traffic increases, Auto Scaling adds new instances, and the load balancer starts routing traffic to them automatically

  • 📉 As traffic decreases, Auto Scaling removes instances, and the load balancer stops sending traffic their way

This combination — load balancer + auto scaling — is what people mean when they talk about "elastic" cloud infrastructure: the system grows and shrinks with demand, without manual intervention.