Scrivio Interview library
DesignAdvanced6 min read · updated 13 November 2026

A service runs in three regions sized for 40, 35 and 25 percent of global traffic. Product requires that users reach the nearest healthy region and that the loss of any one region causes no outage. Last year a failover overloaded the surviving region.

Design global traffic management, including capacity, health and how traffic moves during failover.

Route users to the nearest healthy region by latency or geography with per-region health checks, preferably through a global anycast or edge layer that shifts traffic without waiting for DNS caches. Size every region for failure: losing the 40 percent region means the other two must carry roughly 60 and 40 percent, so each needs that capacity ready or autoscaling fast enough. Shift traffic gradually with weights, cap what any region may receive and shed low-priority traffic first, make sure moved users find their data through replication, and rehearse regional failover regularly.

Why this question is asked

Running in three regions is supposed to make the loss of one survivable, but the last failover proves that more regions do not help if the surviving ones cannot carry the load. Interviewers ask this to see whether we design global routing, capacity and data together, with real numbers. In this answer, we will set out the routing layer, work through the capacity arithmetic for each failure, design how traffic moves without overloading anyone, deal with the data question, and finish with rehearsal.

1Routing Users to the Nearest Healthy Region

The first layer chooses a region for each user. DNS-based routing with latency or geographic rules and health checks works, but its speed is limited by TTLs and by clients that cache addresses or hold connections. A better front door is a global anycast or edge layer, such as a global load balancer or a CDN in front of the API, with fixed addresses announced from many sites. It terminates connections near the user and forwards each request to a region chosen by latency and health, and it can move traffic in seconds because the user's address never changes.

Health for this layer must be judged per region from real signals, not just a probe of one endpoint: the error rate and latency of real requests in that region, from several vantage points, so a regional failure is detected within a minute or two and a single noisy probe does not trigger a move.

2Sizing for Failure: The Arithmetic

Normal traffic is split 40, 35 and 25 percent between regions A, B and C. When one fails, its users move to the nearest surviving region, which in practice splits them roughly in proportion to the others' sizes. So if A fails, its 40 percent splits about 35 to 25 between B and C: B gets about 23 points and C about 17. B must then serve about 58 percent of global traffic and C about 42.

We do the same for each region and take the worst case for each survivor. The table shows that every region needs far more capacity than its normal share: A needs about 62 percent of global peak, B about 58 and C about 42. Last year's failure is now easy to explain: if the surviving region had capacity for its normal share plus a margin of 20 or 30 percent, it was nowhere near enough.

Global share each region must serve after a failure
Failed regionA (40)B (35)C (25)
none403525
A fails-about 58about 42
B failsabout 62-about 38
C failsabout 53about 47-
capacity neededabout 62about 58about 42
Assumes a failed region's users split in proportion to the survivors' normal sizes. Real splits follow geography, so measure them.

We have two ways to have that capacity when it is needed. We can keep it running all the time, which is expensive but immediate, or we can autoscale, which is cheaper but only works if scaling is faster than the failover. Adding 60 percent more capacity in two minutes is rarely realistic for stateful tiers, so a common choice is to keep enough running to survive the first 15 to 20 minutes with shedding, and autoscale the rest.

3Moving Traffic Without Overloading the Survivors

A failover that moves everyone in one second sends a wall of cold connections, cache misses and new logins at the survivors. So we move traffic with weights: the global layer shifts the failed region's share in steps, for example 25 percent of it every minute, while autoscaling starts in the receiving regions. When the region is gone completely, there is no choice about the destination, but we still have control over how much each region accepts.

That control is a cap. Each region publishes how much traffic it can take, and the global layer never sends more. Beyond the cap, the region sheds load in priority order: background syncs, recommendation calls and analytics are rejected or queued first, so checkout, login and core reads keep working. The difference between a degraded but working service and a second regional outage is usually this shedding, because an overloaded region that accepts everything fails for everyone.

Step throughRegional failover with caps
  1. Region A unhealthy for 2 minreal error rate, several vantage points
  2. Shift A's weight in steps25 percent of its share per minute
  3. Autoscale B and Cstarts with the first step
  4. Receiving region over its cap?
    YesShed low-priority trafficNoTake the next step
  5. All of A movedkeep caps and shedding until scaled

5 steps in order. Play them, or step through them one at a time.

Weights spread the move over minutes; caps and shedding protect the survivors.

4The Data Question

Moving users is pointless if they cannot find their data. What a regional failover can promise depends on replication. If user data is replicated asynchronously across regions, for example with PostgreSQL logical replication or a multi-region database with asynchronous replicas, the surviving region has a copy that is seconds behind. Users can continue, but the last few seconds of writes in the failed region may be missing until it returns. If data is synchronously replicated, nothing is lost, but every write pays cross-region latency.

Many designs mix both. Data where losing a few seconds is unacceptable, such as payments, is written synchronously or has a single home region with a careful failover. Data where it is acceptable, such as preferences and history, is asynchronous. The product promise, no outage on regional loss, must be written in those terms: users can keep working, and here is what they might see missing.

5Rehearse It Regularly

The only way to know that a regional failover works is to do it. Run regular drills that shift real traffic away from one region, first a small share and later a full evacuation in a quiet period, and record how long each step takes: detection, the traffic shift, autoscaling, cache warming, and the return. Each drill finds something, a hidden dependency on a single region, a quota that blocks scaling, a slow cache warm-up, and fixing those findings is what turns the design into a working failover.

6Follow-up questions

What should happen when a region recovers: move users back at once or slowly?

Slowly. A recovered region is cold: empty caches, few connections, and possibly data replication still catching up. We first confirm it is healthy for a sustained period, check that replication has caught up so returning users do not see older data, and then shift traffic back with weights over 15 to 30 minutes, watching error rates and latency. Moving everyone back at once risks a second failure in the recovering region and a confusing flip of data for users.

Why not run every region at the same size?

Equal sizes make the arithmetic simpler, but users are not evenly distributed, and serving them from a far region adds latency. Unequal regions are fine as long as each one is sized for its own share plus its share of any failed region, which is what the table computes.

7Conclusion

In this answer, we routed users by latency or geography with per-region health through a global edge that shifts traffic without waiting for DNS. We worked out that each region needs capacity for its worst failure case, about 62, 58 and 42 percent of global traffic here, moved traffic gradually with weights, capped what any region accepts and shed low-priority work first, tied the failover promise to the replication model of the data, and made regular drills part of the design.

What to say in the interviewAbout 90 seconds aloud

Open with

I would put a global anycast or edge layer in front, with fixed addresses, routing each user to the nearest healthy region by latency, with region health judged from real error rates and latency from several vantage points.

Then, if they want more

DNS with short TTLs can work, but caches and long connections make it slow, and the edge can shift in seconds. Then I size for failure, because that is what broke last year.

If the 40 percent region fails, its users split roughly in proportion, so the other two need about 58 and 42 percent of global traffic; doing that for every case, the regions need capacity for about 62, 58 and 42 percent, not 40, 35 and 25.

Either that runs all the time or autoscaling must be fast enough, and usually it is a mix. During failover I shift weights in steps, say a quarter of the failed region's share per minute, and each region has a cap above which it sheds low-priority traffic like analytics and recommendations so checkout and login keep working.

I also tie the promise to the data model: with asynchronous replication, moved users may miss the last seconds of writes, so critical data like payments needs synchronous writes or careful single-home failover. Finally, we rehearse regional failovers regularly and record each step's duration.

About this answer

Last updated
13 November 2026
Checked
Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the official documentation for the version you use. What the checks cover
Where the question comes from
Written by Scrivio for practice. It is not taken from an interview.
Report an issue with this answer

Copy the line below and send it to the author with what you found. It carries the address of this page.

Issue with "Design global traffic management, including capacity, health and how traffic moves...": https://scrivio-interview-library.netlify.app/architecture/load-balancing-networking/ad6cc92c22/