Stage 4 · Provision
Load Balancing & Traffic Management
Global Load Balancing
Geo-DNS, anycast, and latency-based routing across continents for global applications.
Why Global Load Balancing?
Global load balancing distributes traffic across multiple regions or data centers worldwide. It ensures users are routed to the nearest or best-performing region, provides regional failover, and enables multi-region active-active deployments. Without it, all users hit a single region regardless of their location.
Geo-DNS Routing
Geo-DNS resolves DNS queries based on the geographic location of the client. A user in Tokyo gets an IP address for the Tokyo region, while a user in London gets the London IP. This is the simplest form of global load balancing but has limitations due to DNS caching.
User in Tokyo queries api.example.com
│
▼
Route 53 Geo-DNS
│
├── User IP: 203.0.113.x (Japan)
│ └── Returns: 198.51.100.10 (Tokyo region)
│
└── User IP: 198.51.100.x (US)
└── Returns: 203.0.113.20 (US-East region)Geo-DNS is simple but not precise. IP geolocation can be wrong, DNS caching causes stale routing, and it does not account for actual network performance.
Anycast Routing
Anycast advertises the same IP address from multiple locations. BGP routes each request to the nearest location based on network topology. This provides sub-second failover and is used by Cloudflare, Google, and major CDNs.
IP: 1.1.1.1 advertised from:
├── Cloudflare LA ── BGP ──► US-West users
├── Cloudflare NYC ── BGP ──► US-East users
├── Cloudflare LON ── BGP ──► Europe users
└── Cloudflare TYO ── BGP ──► Asia users
Same IP, different locations, BGP selects the nearest.Anycast provides automatic failover — if one location goes down, BGP reroutes traffic to the next closest. This is how Cloudflare handles DDoS attacks at scale.
Latency-Based Routing
Latency-based routing measures actual network latency to each region and routes to the fastest responding endpoint. This is more accurate than geo-DNS because it accounts for network conditions, not just geography. Route 53 supports this natively.
- Route 53 latency-based routing probes each region.
- Returns the IP of the region with the lowest latency.
- Accounts for network congestion, not just distance.
- Combine with health checks for automatic failover.
Cloud Provider Solutions
| Provider | Service | Features |
|---|---|---|
| AWS | Route 53 | Geo, latency, weighted, failover routing |
| GCP | Cloud DNS + Cloud CDN | Any-cast, latency-based |
| Azure | Traffic Manager | Priority, weighted, performance, geographic |
| Cloudflare | Load Balancing | Anycast, geo, latency-based |
Design Considerations
- DNS TTL — Low TTLs (60s) enable faster failover but increase DNS load.
- Health checks — Route only to healthy regions. Use active health checks.
- Failover priority — Define clear failover chains: US → EU → APAC.
- Data locality — Users routed to a region must get data from that region.
- Cost — Cross-region data transfer is expensive. Minimize cross-region reads.
Global load balancing is your first defense against regional outages. If a region goes down, traffic should automatically shift to healthy regions within seconds. This must be tested regularly.
Mark this lesson complete to store local progress and unlock a cleaner resume path the next time you visit.