Global traffic management
Steer users to the right region with GeoDNS, anycast and health-aware routing, and fail over fast.
16 min readGeoDNS
With GeoDNS, the authoritative DNS server answers with different IP addresses depending on where the query comes from, usually the location of the user's recursive resolver. It can also weight answers (send 10% to a new region) and drop unhealthy regions based on health checks. Its weakness is caching: you set a TTL of 30 to 60 seconds, but some resolvers and clients hold answers far longer, so a DNS-based failover takes minutes to move the last stragglers. A user on a public resolver far from home may also be routed by the resolver's location rather than their own.
Anycast
With anycast, the same IP address is announced via BGP from many points of presence, and the internet's routing delivers each packet to the nearest one in network terms. There is nothing to cache, so if a site withdraws its announcement, traffic shifts in seconds. CDNs and DNS providers use anycast for their edges, and cloud global load balancers expose a single anycast IP that terminates connections at the nearest edge and forwards them over the provider's private backbone to a healthy region.
- Great for short, stateless exchanges such as DNS and TLS termination at the edge
- Route changes mid-connection can break long-lived TCP sessions, so terminate at the edge and proxy inward
Health checks and failover policy
Routing is only as good as the health signal. Check from several vantage points, test a real dependency path (a synthetic read through the service), and require several consecutive failures before draining a region to avoid flapping. Decide in advance what a partial failure means: if a region serves 40% errors, draining it may be right, but draining two regions at once can overload the third. Automate the common case and keep a manual, rehearsed runbook for the rest.
On the canvas
Model global routing with a dns component in front of per-region load balancers, and a cdn for cacheable content so static assets never leave the edge. In the Feedback panel, the routing policy decides how a region failure redistributes traffic; pair it with the capacity headroom from the previous lesson. A good design states the expected failover time explicitly, for example under 30 seconds with anycast at the edge or a few minutes with DNS alone, and accepts that in-flight requests to the failed region will error and must be retried by clients, safely, using the idempotency keys from earlier in the course.
Key takeaways
- GeoDNS routes by resolver location but failover is slowed by caching beyond the TTL
- Anycast routes to the nearest edge via BGP and fails over in seconds
- Use real-path health checks from several locations and avoid flapping
- Global routing and per-region capacity headroom must be designed together
Sign in to track lessons and earn badges.