Load balancing concepts (for example, Application Load Balancer)

Task Statement 3.4: Determine high-performing and/or scalable network architectures.

📘AWS Certified Solutions Architect – (SAA-C03)


1. What is Load Balancing?

In cloud networking, load balancing is a way to distribute incoming traffic (requests) across multiple servers or resources to ensure:

  • High availability – If one server fails, others handle the traffic.
  • Scalability – Can handle more traffic by adding more servers.
  • Better performance – Requests are spread evenly, avoiding overload.

In AWS, load balancing is provided by Elastic Load Balancing (ELB). ELB automatically distributes incoming application or network traffic across multiple targets, like:

  • EC2 instances
  • Containers
  • IP addresses
  • Lambda functions

2. Types of AWS Load Balancers

AWS provides three main types of load balancers:

Load Balancer TypeLayerUse CaseKey Points
Application Load Balancer (ALB)Layer 7 (HTTP/HTTPS)Web applications, microservicesCan route based on URL path, host, headers, or HTTP methods; supports WebSockets
Network Load Balancer (NLB)Layer 4 (TCP/UDP)High-performance, low-latency appsHandles millions of requests per second, static IP support
Gateway Load Balancer (GLB)Layer 3 (IP)Network appliances like firewallsTransparent traffic inspection, scales appliance clusters

For this exam, Application Load Balancer (ALB) is the primary focus.


3. Application Load Balancer (ALB)

Key Features of ALB

  1. Layer 7 Routing
    ALB can inspect the content of requests and route them based on:
    • URL paths (e.g., /images → server group A, /api → server group B)
    • Host headers (e.g., app.example.com → server group C)
    • HTTP methods (GET, POST, etc.)
    • Query strings or source IPs
  2. Target Groups
    ALB sends traffic to target groups, which are collections of resources such as:
    • EC2 instances
    • IP addresses
    • Lambda functions
    Target groups allow flexible scaling and management of resources.
  3. Health Checks
    ALB automatically checks the health of each target.
    • Unhealthy targets are removed from traffic routing.
    • Healthy targets continue receiving traffic.
    • Helps ensure high availability.
  4. Security
    • Works with AWS Certificate Manager (ACM) to handle HTTPS/TLS.
    • Integrates with security groups and IAM roles.
    • Supports user authentication with Cognito or OIDC providers.
  5. Sticky Sessions (Optional)
    • Can route multiple requests from the same user to the same server.
    • Useful for sessions that require maintaining state in memory.
  6. Cross-Zone Load Balancing
    • Can distribute traffic evenly across multiple Availability Zones (AZs).
    • Ensures high availability even if one AZ fails.
  7. WebSockets and HTTP/2 Support
    • Supports modern protocols for real-time communication and better performance.

4. How ALB Works Step-by-Step

  1. User sends a request (HTTP/HTTPS) to ALB.
  2. ALB checks listener rules (port and protocol) and routing rules.
  3. ALB evaluates host-based or path-based rules.
  4. ALB forwards request to healthy targets in the corresponding target group.
  5. Target processes the request and responds.
  6. ALB sends the response back to the user.

5. Key Exam Points to Remember

  • ALB works at Layer 7 (HTTP/HTTPS), unlike NLB (Layer 4).
  • ALB supports content-based routing.
  • ALB requires listeners (port + protocol) and target groups.
  • Health checks are critical – unhealthy targets are removed automatically.
  • ALB can scale automatically with traffic.
  • Can integrate with WAF (Web Application Firewall) for security.

6. Comparison: ALB vs NLB (for exam purposes)

FeatureALBNLB
OSI LayerLayer 7Layer 4
RoutingURL, host, headers, HTTP methodsTCP/UDP only
Use CaseWeb apps, microservicesHigh-performance TCP apps
ProtocolsHTTP, HTTPS, WebSocketsTCP, UDP
Target TypesEC2, Lambda, IPEC2, IP
Sticky SessionsYesNo

7. Best Practices for High-Performance and Scalable Architecture

  • Deploy across multiple AZs for high availability.
  • Enable health checks to prevent routing to failing targets.
  • Use auto-scaling groups with ALB for dynamic scalability.
  • Enable logging (ALB access logs) for monitoring traffic.
  • Consider caching and CDN (CloudFront) with ALB for faster responses.

Summary for Exam:

  • Know what ALB is and its Layer 7 features.
  • Understand target groups, listeners, and health checks.
  • Remember routing rules (path-based, host-based, method-based).
  • Know ALB vs NLB differences.
  • Remember high availability and scalability features like multi-AZ deployment and auto-scaling.
Buy Me a Coffee