Azure 66: Multi-Region Failover & Traffic Manager
easy⏱ 5 mincourseazure
Active-passive vs active-active
Active-passive: traffic goes to the primary; the secondary stands by and takes over on failure (simpler, cheaper, some failover lag). Active-active: both regions serve, splitting load (no failover lag, but you must handle cross-region data consistency). Traffic Manager (DNS-based) and Front Door (anycast edge) both do health-based routing — Front Door fails over faster because it doesn't wait for DNS TTLs.
RTO & RPO
RTO (Recovery Time Objective): how long until you're back up. RPO (Recovery Point Objective): how much data you can afford to lose (the replication lag). Geo-replicated databases shrink RPO; automated failover shrinks RTO. Both cost money — match them to what the business actually needs, per service.
// Front Door: health probe per backend
// unhealthy primary -> route to secondary in <30s
Model the failover
Write route(primaryHealthy, secondaryHealthy) returning primary when healthy, else secondary, else none. Across a sequence of health states, count how many times you fell over to secondary and log route -> X for each, then failovers: N.
Test the failover, or you don't have one
An untested DR plan is a hope. Run regular failover drills — most multi-region setups fail their first real failover on something nobody exercised: stale secrets, un-replicated data, a hardcoded primary endpoint.
Quiz: which fails over faster?
Front Door (anycast edge, ~seconds) fails over faster than Traffic Manager (DNS-based, bounded by DNS TTL caching).