Why Load Balancing?
High availability requires more than redundant VMs — you also need traffic distribution so workloads stay online even if some components fail. Azure provides different load balancing services at different layers of the network stack, each suited for specific scenarios.
1. Azure Load Balancer (Layer 4 – Transport)
Definition:
Distributes TCP/UDP traffic across healthy VMs in a region.
Key Features:
-
Supports inbound and outbound scenarios.
-
Health probes to check VM health.
-
High throughput, low latency.
-
Two types:
-
Basic LB (single availability set, limited features).
-
Standard LB (highly scalable, zone-redundant).
-
Use Cases:
-
Distributing web traffic across VM scale sets.
-
Load-balancing SQL Always On clusters.
2. Application Gateway (Layer 7 – HTTP/HTTPS)
Definition:
Application-aware load balancer with Web Application Firewall (WAF).
Key Features:
-
SSL/TLS termination.
-
Path-based routing (e.g., /images → storage, /checkout → app server).
-
Session affinity (“sticky sessions”).
-
WAF protects against SQL injection, XSS.
Use Cases:
-
Secure web applications.
-
E-commerce portals with multiple backend pools.
-
Apps needing SSL offload and WAF.
3. Azure Front Door (Global Layer 7)
Definition:
Global application delivery service for edge-based load balancing and acceleration.
Key Features:
-
Anycast routing for low latency.
-
Caching + CDN-like acceleration.
-
Supports WAF.
-
Multi-region failover at edge.
Use Cases:
-
Global websites and SaaS apps.
-
Multi-region app failover.
-
Applications requiring high performance worldwide.
4. Azure Traffic Manager (DNS-Based)
Definition:
DNS-based traffic distribution across regions.
Key Features:
-
Routing methods: Priority, Weighted, Performance, Geographic, Multi-Value, Subnet.
-
Doesn’t move traffic itself → only resolves DNS to endpoints.
-
Works with VMs, App Services, Front Door.
Use Cases:
-
Geographic compliance routing (EU users → EU region).
-
Failover between regions using DNS priority.
-
Distribute users to closest healthy endpoint.
Comparison Table
| Service | Layer | Scope | Best For |
|---|---|---|---|
| Load Balancer | L4 | Regional | VM-based workloads, TCP/UDP apps |
| App Gateway (WAF) | L7 | Regional | Secure web apps, SSL offload |
| Front Door | L7 | Global Edge | Global web apps, acceleration |
| Traffic Manager | DNS | Global | Region-based routing, compliance |
Example Enterprise Scenario
A global e-commerce platform requires:
-
Regional VM load distribution.
-
Web protection against SQL injection and XSS.
-
Fast performance for users in US, EU, APAC.
-
Failover between East US and West US if one region fails.
Correct design:
-
Use Azure Load Balancer for VM traffic distribution.
-
Place Application Gateway with WAF in front of the web app.
-
Use Front Door for global acceleration and edge failover.
-
Use Traffic Manager for DNS-based region routing.
Confusion Buster
-
Load Balancer vs App Gateway
-
LB = transport-level (L4).
-
App Gateway = application-level (L7, with WAF).
-
-
Front Door vs Traffic Manager
-
Front Door = edge-based, real traffic routing + acceleration.
-
Traffic Manager = DNS-based, only endpoint resolution.
-
-
Front Door vs CDN
-
FD = full app delivery + failover.
-
CDN = static content caching.
-
Exam Tips
-
“Which service protects web apps against SQL injection?” → Application Gateway (WAF).
-
“Which load balancer provides low-latency global routing?” → Azure Front Door.
-
“Which service routes traffic to closest region at DNS level?” → Traffic Manager.
-
“Which Azure LB type distributes VM TCP/UDP traffic?” → Azure Load Balancer.
What to Expect in the Exam
-
Direct Q: “Which service provides DNS-based global routing?” → Traffic Manager.
-
Scenario Q: “Company needs WAF + SSL offload for its web app.” → Application Gateway.
-
Scenario Q: “Global SaaS app requires fast performance worldwide.” → Front Door.
-
Trick Q: “Load Balancer can protect apps against SQL injection.” → False (App Gateway does).