Study Guide865 words

AWS Elastic Load Balancing (ELB) Study Guide

Load balancing concepts (for example, ALB)

AWS Elastic Load Balancing (ELB) Study Guide

Learning Objectives

After studying this guide, you should be able to:

  • Differentiate between the three primary types of AWS Load Balancers (ALB, NLB, GLB).
  • Identify the appropriate OSI layer for each load balancer type.
  • Explain how load balancers integrate with EC2 Auto Scaling to ensure High Availability (HA).
  • Configure basic path-based and host-based routing rules for an Application Load Balancer.
  • Understand the role of health checks in maintaining application reliability.

Key Terms & Glossary

  • Listener: A process that checks for connection requests using a specific protocol and port.
  • Target Group: A logical grouping of resources (EC2, Lambda, IP addresses) to which the load balancer routes traffic.
  • Health Check: A periodic ping or request sent by the load balancer to targets to ensure they are responding. If a target fails, traffic is diverted.
  • OSI Model: The Open Systems Interconnection model that characterizes and standardizes the communication functions of a telecommunication or computing system.
  • GENEVE Protocol: The encapsulation protocol used primarily by Gateway Load Balancers to route traffic to virtual appliances.

The "Big Idea"

Load balancing is the "Traffic Cop" of your AWS architecture. It provides a single point of entry (DNS name) for your users, shielding them from the complexity of your backend. By distributing incoming requests across multiple healthy targets, it ensures that no single server becomes a bottleneck (Scalability) and that the application remains available even if individual servers fail (High Availability).

Formula / Concept Box

FeatureApplication Load Balancer (ALB)Network Load Balancer (NLB)Gateway Load Balancer (GLB)
OSI LayerLayer 7 (Application)Layer 4 (Transport)Layer 3 (Network)
ProtocolsHTTP, HTTPS, gRPCTCP, UDP, TLSIP (GENEVE)
Routing BasisURL Path, Hostname, CookiesIP Protocol, PortIP Packets
Use CaseMicroservices, Web AppsHigh performance, Static IPsFirewalls, Intrusion Detection

Hierarchical Outline

  • I. Introduction to Elastic Load Balancing (ELB)
    • A. Purpose: Distribute incoming traffic; provide a single DNS entry.
    • B. High Availability: Distributes traffic across multiple Availability Zones (AZs).
  • II. Load Balancer Types
    • A. Application Load Balancer (ALB)
      • Layer 7 visibility (HTTP headers, cookies).
      • Ideal for Microservices and container-based apps.
    • B. Network Load Balancer (NLB)
      • Layer 4 capability (Ultra-low latency).
      • Can handle millions of requests per second; supports Static IPs.
    • C. Gateway Load Balancer (GLB)
      • Layer 3 management for virtual appliances.
      • Simplifies deployment of third-party security stacks.
  • III. Core Components
    • A. Listeners & Rules: Define how traffic is processed (e.g., "If Path is /api, go to Target Group B").
    • B. Target Groups: Where the traffic ends up (EC2 instances, Containers, etc.).

Visual Anchors

Traffic Flow Diagram

Loading Diagram...

OSI Layer Mapping

Compiling TikZ diagram…
Running TeX engine…
This may take a few seconds

Definition-Example Pairs

  • Path-Based Routing: Routing requests to different target groups based on the URL path.
    • Example: Requests to example.com/images go to an S3-optimized group, while example.com/orders go to a high-compute group.
  • Sticky Sessions (Session Affinity): A mechanism to bind a user's session to a specific target.
    • Example: A shopping cart application that stores data locally on the server needs the user to return to the same instance for the duration of their session.
  • Cross-Zone Load Balancing: Distributing traffic evenly across all registered targets in all enabled Availability Zones.
    • Example: If AZ1 has 2 instances and AZ2 has 8, cross-zone balancing ensures each of the 10 instances receives 10% of the traffic.

Worked Examples

Setting up an ALB for a Multi-Tier Application

  1. Requirement: You have a web front-end and a separate API back-end.
  2. Configuration: Create an Application Load Balancer.
  3. Listener: Add an HTTP listener on Port 80.
  4. Target Groups:
    • Create TG-Frontend (port 80).
    • Create TG-API (port 8080).
  5. Rules:
    • Default Rule: Forward all traffic to TG-Frontend.
    • Path Rule: If Path is /api/*, forward to TG-API.
  6. Outcome: Users visiting the main site hit the frontend, but any programmatic calls to the API path are transparently routed to the API servers.

Checkpoint Questions

  1. Which load balancer type should you use if your application requires a single static IP address for its entry point? (Answer: NLB)
  2. At which OSI layer does the Application Load Balancer operate? (Answer: Layer 7)
  3. If an EC2 instance fails a health check, what action does the load balancer take? (Answer: It stops sending traffic to that specific instance until it passes a health check again.)
  4. How does an ALB handle traffic from a domain name like app.example.com vs dev.example.com? (Answer: Through Host-based routing rules.)
  5. What protocol does the Gateway Load Balancer use to communicate with virtual appliances? (Answer: GENEVE on port 6081.)

Ready to study AWS Certified Solutions Architect - Associate (SAA-C03)?

Practice tests, flashcards, and all study notes — free, no sign-up needed.

Start Studying — Free