AWS Load Balancers

Jul 15, 2024

AWS Load Balancers

Presenter: Abhishek

Introduction

  • Deep dive into AWS Load Balancers
  • Part of the AWS DevOps Zero to Hero series (Day 26)
  • High demand topic from viewers
  • Focus: Different types of AWS Load Balancers with real-life examples

Key Concepts

  • Load Balancer: Manages incoming web traffic across multiple servers
  • OSI Model: 7-layer model of network communication; key to understanding load balancer functionality

Scenario: Importance of Load Balancers

  • Initial setup: Single EC2 instance
  • Issues: Increased users lead to slowness and downtime
  • Solution: Deploy multiple EC2 instances with a load balancer in front
    • Load balancer distributes requests equally (e.g., round-robin)
    • Ensures highly available and responsive application

Types of AWS Load Balancers

  1. Application Load Balancer (ALB)

    • Operates at Layer 7 (Application Layer)
    • Routes traffic based on HTTP/HTTPS details like path, host, and headers
    • Suitable for complex routing needs (e.g., different paths on a website)
    • Features like SSL offloading
    • Pros: Advanced routing capabilities
    • Cons: Costly, potential latency
  2. Network Load Balancer (NLB)

    • Operates at Layer 4 (Transport Layer)
    • Routes TCP/UDP traffic quickly
    • Suitable for applications needing low latency (e.g., streaming platforms, game servers)
    • Pros: Fast, less costly, supports sticky sessions
    • Cons: Limited routing capabilities compared to ALB
  3. Gateway Load Balancer (GWLB)

    • Used for virtual appliances like VPNs and firewalls
    • Ensures high security and proper traffic handling
    • Offers encrypted traffic transmission
    • Not suitable to replace with ALB or NLB due to specialized traffic requirements

Understanding the OSI Model

  • Layer 7 (Application): Protocols such as HTTP, FTP; determines the type of request
  • Layer 6 (Presentation): Encoding/Encryption (e.g., SSL/TLS)
  • Layer 5 (Session): Manages sessions between client and server
  • Layer 4 (Transport): Splits data into packets (TCP/UDP)
  • Layer 3 (Network): Packet routing through routers
  • Layer 2 (Data Link): Manages transmission over local network segments
  • Layer 1 (Physical): Physical cabling and connections

Choosing a Load Balancer

  • ALB: For HTTP layer (Layer 7) routing based on path, headers, etc.
  • NLB: For TCP/UDP (Layer 4) high-speed, low-latency routing
  • GWLB: For applications needing high security (VPNs, firewalls)

Practical Examples

  • ALB: E-commerce sites, applications needing detailed routing
  • NLB: Game servers, video streaming platforms requiring minimal delay
  • GWLB: Virtual appliances requiring specialized routing and security

Summary

  • Understand traffic and routing needs to choose the right load balancer
  • Consider cost, performance, and specific application requirements

Outro

  • Onwards to the next video in the series
  • Encouragement to continue learning and implementing DevOps practices