Configuring and implementing load balancing solutions

Task Statement 2.1: Implement routing and connectivity between on-premises networks and the AWS Cloud.

📘AWS Certified Advanced Networking – Specialty


1. What is Load Balancing in AWS?

Load balancing is the process of distributing network traffic across multiple resources (like servers or applications) to ensure:

  • High availability (systems stay up and running)
  • Fault tolerance (if one resource fails, others take over)
  • Better performance (no single server is overloaded)

In AWS, load balancers automatically handle traffic distribution between resources.


2. Types of Load Balancers in AWS

AWS provides the Elastic Load Balancing (ELB) service, which has three main types:

A. Application Load Balancer (ALB)

  • Works at Layer 7 (Application Layer) of the OSI model.
  • Can inspect HTTP/HTTPS traffic.
  • Supports:
    • Path-based routing: Sends requests based on URL paths.
      Example: /images → Image servers, /videos → Video servers.
    • Host-based routing: Sends requests based on the hostname in the request.
      Example: app1.example.com → App1 servers, app2.example.com → App2 servers.
  • Supports WebSocket and HTTP/2 protocols.
  • Can route traffic to multiple target groups (groups of EC2 instances, IPs, or Lambda functions).

B. Network Load Balancer (NLB)

  • Works at Layer 4 (Transport Layer).
  • Handles TCP/UDP traffic.
  • Very fast and can handle millions of requests per second.
  • Maintains static IP addresses and supports elastic IPs.
  • Ideal for high-performance applications where speed is critical.

C. Gateway Load Balancer (GLB)

  • Works at Layer 3 (Network Layer).
  • Designed for virtual appliances like firewalls, intrusion detection systems (IDS), and deep packet inspection.
  • Simplifies scaling third-party network appliances in AWS.
  • Uses a single entry point to route traffic to multiple appliances.

3. Components of AWS Load Balancers

1. Listeners

  • A listener is a process that checks for connection requests on a port (like HTTP 80 or HTTPS 443).
  • Each listener has a protocol and port, and it forwards traffic to target groups.

2. Target Groups

  • A target group is a collection of resources (EC2 instances, Lambda, or IPs) that serve traffic.
  • Health checks are performed to ensure only healthy targets receive traffic.
  • Can be dynamic (scale automatically with Auto Scaling).

3. Health Checks

  • Load balancers perform periodic checks on targets.
  • If a target fails a health check, it is removed from the pool until it becomes healthy again.
  • Health checks can be HTTP, HTTPS, TCP, or custom depending on the load balancer type.

4. Load Balancer Security

1. Security Groups

  • ALBs and NLBs use security groups to control incoming and outgoing traffic.
  • Can allow only specific IPs, ports, or protocols.

2. SSL/TLS Termination

  • ALB can terminate SSL/TLS connections at the load balancer level.
  • Offloads encryption/decryption from backend servers.
  • Improves performance and simplifies certificate management.

5. Integrating Load Balancers with Other AWS Services

  • Auto Scaling: ALB and NLB can automatically scale resources based on traffic.
  • Amazon Route 53: Can use alias records to route traffic to an ELB.
  • VPC and Subnets: Load balancers must be deployed in subnets across multiple Availability Zones (AZs) for high availability.
  • AWS WAF: ALB can integrate with AWS Web Application Firewall for additional security.

6. Key Exam Points

  1. ALB vs NLB vs GLB
    • ALB: HTTP/HTTPS, Layer 7, path/host-based routing.
    • NLB: TCP/UDP, Layer 4, high performance, static IP.
    • GLB: Network appliances, Layer 3, centralized traffic management.
  2. Target Groups
    • Can be EC2, IP addresses, or Lambda functions.
    • Must configure health checks.
  3. Listeners
    • Each listener has a protocol/port and forwards traffic to a target group.
  4. Cross-Zone Load Balancing
    • Distributes traffic evenly across all targets in all AZs.
  5. Sticky Sessions
    • ALB supports session stickiness (send the same client to the same backend).
  6. Security
    • Use security groups and optionally AWS WAF.
    • SSL/TLS termination is supported by ALB.

7. Implementation Steps (Basic Setup)

  1. Create a Load Balancer:
    • Choose ALB/NLB/GLB based on your needs.
  2. Configure Listeners:
    • Define port and protocol (e.g., HTTP 80, HTTPS 443).
  3. Create Target Groups:
    • Register EC2 instances, IP addresses, or Lambda functions.
    • Configure health checks.
  4. Associate Security Groups:
    • Allow traffic on listener ports.
  5. Deploy in Multiple AZs:
    • Ensures high availability.
  6. Test Connectivity:
    • Confirm requests are routed correctly and failed targets are skipped.

8. Tips for the Exam

  • Remember the Layer differences: ALB (7), NLB (4), GLB (3).
  • Know when to use path-based vs host-based routing.
  • Understand health checks and target groups.
  • Be ready to answer hybrid connectivity scenarios, e.g., traffic coming from on-premises networks to AWS through a load balancer.
  • Know integration points: Route 53, Auto Scaling, WAF, VPC subnets.

By understanding these key points, you can confidently answer questions about load balancing, routing traffic, and connecting on-premises networks to AWS for the exam.

Buy Me a Coffee