IntermediateLesson 5 of 10

Load Balancing and Traffic Management

Choose the right Azure traffic service based on layer, protocol, and scope: Azure Load Balancer, Application Gateway, Front Door, and Traffic Manager.

What Is It? (Simple Explanation)

Load balancing spreads traffic across healthy backends so one overloaded server does not bring down the application.

Why Do We Need It?

How It Works (Technical)

ServiceLayerScopeBest For
Azure Load BalancerL4 TCP/UDPRegionalVM scale set traffic distribution
Application GatewayL7 HTTP/HTTPSRegionalPath-based routing + WAF
Azure Front DoorL7 global edgeGlobalGlobal web acceleration and failover
Traffic ManagerDNS-basedGlobalEndpoint selection by DNS policy

Real-world Analogy

Load Balancer is a receptionist assigning visitors to available staff. Traffic Manager is a city-level signboard sending people to different branches.

Visual Representation

Global + Regional Traffic Flow
User
Global request
Front Door / Traffic Manager
Select best region
App Gateway
WAF + path routing
Azure Load Balancer
Distribute to VM backends

Hands-on Commands

Azure CLI (Load Balancer)
# Create public load balancer
az network lb create -g rg-lb -n lb-web --sku Standard --public-ip-address lb-pip --frontend-ip-name fe-web --backend-pool-name be-web

# Create health probe
az network lb probe create -g rg-lb --lb-name lb-web -n probe-http --protocol Http --port 80 --path /

# Create load balancing rule
az network lb rule create -g rg-lb --lb-name lb-web -n rule-http \
  --protocol Tcp --frontend-port 80 --backend-port 80 \
  --frontend-ip-name fe-web --backend-pool-name be-web --probe-name probe-http

Real-world Use Case

An e-commerce platform uses Front Door for global region failover, Application Gateway with WAF for web-layer protection, and internal load balancer for app-tier VM pools.

Debugging Scenario

Issue: Load balancer is up, but backend receives no traffic.

Interview Questions

Beginner

Difference between Load Balancer and Application Gateway?

Load Balancer works at Layer 4; App Gateway works at Layer 7 and supports HTTP-aware routing and WAF.

Intermediate

Front Door vs Traffic Manager?

Front Door proxies HTTP/HTTPS at edge with acceleration and failover. Traffic Manager is DNS-based endpoint selection, not a proxy.

Scenario-based

How do you design active-active global web delivery?

Use Front Door with multiple regional origins, health probes, and weighted or priority routing combined with regional app gateways and backend pools.

Summary

Select traffic services based on layer and scope: L4 regional balancing, L7 application routing, or global edge/dns routing. Correct selection is a key architecture decision.