Load Balancing • Global Load BalancingMedium⏱️ ~3 min
DNS based GSLB vs Anycast Edge Proxy
The two dominant approaches to global traffic routing are DNS based Global Server Load Balancing (GSLB) and Anycast edge proxies. DNS based GSLB returns different IP addresses to different users based on policies like geographic proximity, measured latency, or weighted capacity. When a user queries for example.com, the authoritative DNS server evaluates the resolver's location and returns the IP of the nearest healthy region. This approach is extremely simple and cheap, scaling to handle billions of queries per day with minimal infrastructure.
The critical limitation is reaction speed. DNS responses are cached by resolvers according to Time To Live (TTL) values, typically 20 to 60 seconds in production. When a region fails, users whose resolvers cached the old answer continue hitting the dead region until the TTL expires. Even worse, some corporate or Internet Service Provider (ISP) resolvers ignore low TTLs and cache for minutes or hours. Amazon Route 53 addresses this with health checks from multiple global vantage points every 10 to 30 seconds, but the DNS caching layer still adds unavoidable latency to failover, usually measured in tens of seconds to minutes.
Anycast edge proxies take a different approach. One global IP address is announced via Border Gateway Protocol (BGP) from many edge PoPs worldwide. Users naturally reach the nearest edge due to BGP routing, which then forwards requests to the best backend region. Google's Maglev and Global Front End (GFE) system uses this architecture across hundreds of PoPs, achieving sub second failover when backend pools change. The edge can make HTTP aware decisions like routing based on request headers, maintaining connection state through consistent hashing, and reusing Transport Layer Security (TLS) sessions to reduce handshake overhead.
The tradeoff is operational complexity and cost. Running a global Anycast network requires physical presence in hundreds of locations, BGP peering relationships, sophisticated traffic engineering, and 24/7 operations to handle route leaks or path anomalies. Cloudflare and Akamai operate at this scale with 300+ edge cities handling tens of millions of requests per second, often reducing end user latency by 20 to 30% for dynamic traffic through smart routing around congested paths. For most companies, DNS based GSLB is the starting point, with Anycast added when sub second failover and connection level control justify the investment.
💡 Key Takeaways
•DNS based GSLB is simple and cheap, handling billions of queries with minimal infrastructure, but failover is bounded by TTL caching at 20 to 60 seconds minimum in practice
•Anycast edge proxies achieve sub second failover and connection level control through BGP routing to hundreds of global PoPs, but require significant operational investment
•Resolver location mismatch is a DNS weakness: corporate or ISP resolvers may be far from end users, routing traffic to suboptimal regions by 100+ milliseconds
•Google's Maglev system uses consistent hashing at Anycast edges to maintain connection stickiness during backend changes while handling millions of QPS per Virtual IP (VIP)
•CDN providers like Cloudflare operate 300+ edge cities and reduce dynamic traffic latency by 20 to 30% through measured RTT and packet loss aware routing around congested paths
•Typical cloud inter region egress costs $0.02 to $0.09 per GB, making DNS based routing to wrong regions materially expensive at 10+ Gbps sustained scale
📌 Examples
Amazon Route 53 combines DNS GSLB with latency based routing policies and health checks every 10 to 30 seconds from global vantage points, keeping TTLs at 20 to 60 seconds
Netflix uses DNS based steering for region selection but relies on resilient client logic and aggressive CDN caching to handle DNS propagation delays during regional failures
Cloudflare's Anycast network announces the same IP from 300+ cities; a user in Singapore hits the Singapore PoP in under 10 ms, which then routes to the optimal origin