Load Balancing & Routing
Azure Load Balancer, Application Gateway, Front Door, Traffic Manager β choose the right load balancing service based on scope, protocol, and routing requirements.
Load balancing design
Azure has four load balancers β the right one depends on two questions:
Question 1: Global or regional? Is traffic coming from one region or worldwide?
Question 2: HTTP or TCP/UDP? Is it web traffic (HTTP/HTTPS) or general network traffic (TCP/UDP)?
Answer those two questions and youβve narrowed to one service. This is one of the most frequently tested patterns in AZ-305.
The load balancing decision matrix
| Factor | Azure Front Door | Traffic Manager | Application Gateway | Azure Load Balancer |
|---|---|---|---|---|
| Scope | Global | Global | Regional | Regional |
| Protocol | HTTP/HTTPS | Any (DNS-based) | HTTP/HTTPS | TCP/UDP |
| OSI Layer | L7 | DNS | L7 | L4 |
| WAF | Yes (built-in) | No | Yes (optional SKU) | No |
| SSL offload | Yes | No | Yes | No |
| URL-based routing | Yes (path, header, query) | No | Yes (path, host) | No |
| Session affinity | Yes | No | Yes (cookie-based) | Yes (IP/protocol tuple) |
| Caching | Yes (edge caching) | No | No | No |
| Health probes | Yes (edge-based) | Yes (endpoint monitoring) | Yes (customisable) | Yes (TCP/HTTP probes) |
| Failover | Instant (edge-based) | DNS TTL-based (30-300 seconds) | Backend pool failover | Backend pool failover |
| Best for | Global web apps, multi-region failover, edge WAF | Global non-HTTP, multi-region DNS routing | Regional web apps, API routing, WAF | Regional VMs, internal services, non-HTTP |
The exam shortcut: Global + HTTP = Front Door. Global + non-HTTP = Traffic Manager. Regional + HTTP = Application Gateway. Regional + non-HTTP = Load Balancer. Memorise this 2x2 matrix.
Common architecture patterns
| Pattern | Services Used |
|---|---|
| Global web app | Front Door β Application Gateway β App Service/VMs |
| Global with non-HTTP | Traffic Manager β Load Balancer β VMs |
| Regional web app | Application Gateway β App Service/VMs |
| Internal services | Internal Load Balancer β VMs/VMSS |
| Multi-region HA | Front Door (primary routing) + Traffic Manager (failover) |
ποΈ Priyaβs load balancing architecture:
Users β Front Door (global edge, WAF, caching)
βββ East US: Application Gateway β App Service (primary)
βββ West Europe: Application Gateway β App Service (secondary)
- Front Door handles global routing, SSL termination, and WAF
- Application Gateway in each region provides URL-based routing to backend services
- Internal Load Balancer distributes internal API traffic between VMs
π¦ Elenaβs design:
Trading clients β Traffic Manager (DNS routing, any protocol)
βββ UK South: Load Balancer β Trading VMs (TCP/custom protocol)
βββ West Europe: Load Balancer β Trading VMs (DR)
- Trading uses a custom TCP protocol (not HTTP) β Traffic Manager + Load Balancer
- Financial data canβt use edge caching β no Front Door
Exam tip: Internal vs external Load Balancer
Azure Load Balancer has two SKUs:
- Public (External): Internet-facing β distributes traffic from the internet to VMs
- Internal: Private IP only β distributes traffic between VMs within a VNet
Common pattern: External Load Balancer for the web tier, Internal Load Balancer for the application/database tier. Internal LB keeps backend services off the internet.
Traffic Manager routing methods
| Method | How It Routes | Best For |
|---|---|---|
| Priority | Always sends to highest-priority endpoint, failover to next | Active-passive DR |
| Weighted | Distributes by weight percentage | Canary deployments, traffic splitting |
| Performance | Routes to closest (lowest latency) endpoint | Global apps, latency-sensitive |
| Geographic | Routes based on userβs geographic location | Data sovereignty, regional compliance |
| MultiValue | Returns multiple healthy endpoints | Client-side load balancing |
| Subnet | Routes based on source IP subnet | Different experiences for different networks |
Knowledge check
ποΈ GlobalTech's customer portal is deployed in two Azure regions. Users worldwide need fast page loads, the application needs WAF protection, and failover between regions should be instant (not DNS-dependent). Which load balancing service should Priya recommend?
π¦ Elena's trading platform uses a custom TCP protocol (not HTTP). It needs global routing to the closest data centre with automatic failover if a region becomes unhealthy. Which load balancing service should she recommend?
π¬ Video coming soon
Congratulations! π Youβve completed all 30 modules of the AZ-305: Designing Microsoft Azure Infrastructure Solutions study guide.
Youβve learned to design: monitoring, identity, governance, data storage, business continuity, compute, application architecture, migration, and networking β all through the lens of architecture decisions and tradeoffs.
Whatβs next?
- Review your flashcards and quiz scores
- Practice with scenario-based questions
- Remember: AZ-305 tests βwhy choose X over Yβ β always explain the tradeoff