advanced 3 min answer

What happens when a globally distributed real-time communication service loses an entire region - and how should DNS, health checks, traffic steering, failover, connection draining and data consistency interact?

failure-modesregional-failurefailoverdnszoomwhat-happens-if
Show the full answer Hide the answer

The sequence, and where each mechanism acts

Seconds 0–10: detection. Health checks fail from multiple external vantage points. Detection must be external and multi-point — a region cannot reliably report its own failure, and a single checker's view is indistinguishable from a network problem between the checker and the region.

Seconds 10–60: steering. New sessions are steered away. This is where design choices become decisive:

  • DNS is a poor failover mechanism on its own. TTLs are honoured inconsistently, resolvers cache beyond them, and clients cache further. Expect a long tail of clients still resolving to the dead region for far longer than the TTL suggests.
  • Anycast plus health-aware routing withdraws the failed region's routes and moves traffic in seconds, without waiting for any cache to expire. For latency-sensitive real-time traffic this is the right primitive.
  • Client-side awareness — clients that receive a list of endpoints and can fail over themselves — is the most reliable layer, because it does not depend on any shared infrastructure resolving correctly.

Existing sessions: the hard part. Real-time media sessions are stateful and pinned to media servers in the failed region. They cannot be migrated mid-call, so they drop. The design question is not how to save them but how they reconnect:

  • Clients must reconnect with jittered backoff, or the surviving regions receive the entire failed region's load simultaneously — the reconnect storm that turns a regional failure into a global one.
  • Surviving regions need capacity headroom sized for absorbing a failed peer, not for their own steady state. This is the expensive, unavoidable cost of regional resilience, and it is the thing that gets cut in budget reviews.
  • Reconnection should be spread across regions rather than all going to the nearest one.

Data consistency during the event

Split by criticality, because a uniform answer is wrong:

  • Session and presence state — regional and ephemeral. Losing it is acceptable; it reconstructs on reconnect. Do not replicate it globally; the cost is high and the value is low.
  • Account, entitlement and configuration data — globally replicated, read-heavy, tolerant of seconds of staleness. Serve reads locally from a replica.
  • Recordings and durable artefacts — replicated with a defined RPO. Some in-flight recordings will be lost; that must be a stated, accepted number rather than a discovery.
  • Billing and usage events — must not be lost or double-counted. Buffered durably at the edge and reconciled after, with idempotent processing.

Connection draining and the return

Draining matters more on the way back than during the failure. When the region recovers, sending it full traffic immediately is how a second outage happens — cold caches, empty connection pools, unwarmed processes. Return traffic gradually, gated on real health signals, and treat the recovered region as a canary rather than as a peer until it proves itself.

The property that decides the outcome

Static stability. The surviving regions must handle the shifted load without needing a control-plane action — no scaling event, no configuration push, no deployment. During a large regional failure the control plane is precisely the thing most likely to be degraded or overwhelmed, and any recovery step that depends on it is a step that may not happen.