Quick revision
The short answer
We keep each request inside one zone wherever possible with zone-aware routing at every hop, so a sick zone only hurts its own share of traffic. One pre-tested evacuation switch, whose state lives in the data plane (for example a flag that health checks read), shifts traffic away from a zone in a single action without creating or deleting resources. The two remaining zones are pre-provisioned to carry the load, stateful systems keep quorum members or standbys in all three zones, gray failure is detected by comparing zones with each other, and evacuation is practised in production until it is routine.
What to remember
In this answer, we designed a payments platform where a degraded zone can be removed quickly and safely: requests stay inside one zone through zone-aware routing, one evacuation switch shifts traffic through health checks rather than control plane calls, the other zones are pre-provisioned and stateful systems span all three zones, per-zone comparison catches gray failures, and regular production drills make evacuation routine.
Your turn
Answer it aloud as you would in the interview, or type your answer below. Then show one part at a time and compare.
We keep each request inside one zone wherever possible with zone-aware routing at every hop, so a sick zone only hurts its own share of traffic. One pre-tested evacuation switch, whose state lives in the data plane (for example a flag that health checks read), shifts traffic away from a zone in a single action without creating or deleting resources. The two remaining zones are pre-provisioned to carry the load, stateful systems keep quorum members or standbys in all three zones, gray failure is detected by comparing zones with each other, and evacuation is practised in production until it is routine.
Why this question is asked
In many systems, a request bounces between zones several times: the gateway in one, a service in another, a cache in a third. That design looks harmless until one zone becomes unhealthy, because then almost every request touches the sick zone somewhere, and taking it out of service means changing settings in many places under pressure. For a payments platform that is not acceptable. Interviewers ask this design question to see whether we can make zone failure a contained, routine event. In this answer, we will see why cross-zone calls spread the damage, then design zone-local routing, a single evacuation switch, capacity and data placement, gray failure detection, and the practice that keeps it working.
1Why Cross-Zone Calls Spread a Zone Failure
Suppose a request makes three hops and each hop picks a target in any of the three zones at random. The chance that a request avoids a given zone entirely is low: every hop has a one in three chance of landing there. With three hops, about 70 percent of requests touch the sick zone at least once (1 - (2/3)^3 = 0.70). So a problem in one zone shows up as errors for most customers, and nobody can tell from the outside which zone is the cause.
Removing the zone is just as hard. The gateway, each service's client load balancer and the cache client each choose targets independently, so evacuating means changing all of them, often through different tools, while the incident is running.
2Keep Each Request Inside One Zone
The first design rule is zone affinity: a request that enters in zone A stays in zone A. The load balancer sends it to a gateway in A, the gateway prefers service instances in A, and the service prefers cache nodes in A. In Kubernetes, topology-aware routing or the Service field trafficDistribution: PreferClose does this for service-to-service calls; client-side load balancers can prefer same-zone instances in the same way.
Requests cross zones only when they must: writes to the database primary, which lives in one zone, or when the local copy of a dependency is unhealthy and the client falls back to another zone. Now a sick zone C hurts only the third of traffic that entered in C, plus calls to anything whose only copy is there. As a side benefit, cross-zone data transfer costs and latency drop.
- Load balancerroutes to healthy zones; reads the evacuation flag
- Gateway in zone Aprefers services in zone A
- Services in zone A
PreferCloserouting; fall back only if local is unhealthy - Cache in zone Azone-local replica or cluster
- Databaseprimary in one zone, synchronous standby in another
5 layers, from the top down. Step through them one at a time.
Only the database write path crosses zones by design.
3One Evacuation Switch, Kept in the Data Plane
Now we need a way to take a zone out of service in one step. We build a single zone evacuation switch: one action that makes the load balancer stop sending traffic to zone C and makes every routing layer stop choosing targets in C. Its state should live in the data plane. A good pattern is a flag, for example a small file or key replicated to every zone, that health checks read: when the flag for zone C is set, every health check in C starts failing, so load balancers and service routing remove those targets through mechanisms that are already running.
Notice what we avoid: API calls that create, modify or delete resources during the event. Those go through the provider's control plane, which may be slow or throttled while a zone is in trouble. Failing health checks only use the normal traffic path, which keeps working. Some providers offer a zonal shift feature that works the same way, and it is worth using where available.
4Capacity and Stateful Systems
An evacuation switch is useless if the remaining zones cannot carry the load. So capacity is pre-provisioned: each zone runs enough that two zones handle peak without scaling, which in a three-zone design means keeping normal utilisation below about two thirds of the safe maximum.
Stateful systems need their own plan. Quorum-based systems, such as etcd or Kafka in KRaft mode, keep one member in each zone so losing one still leaves a majority. The PostgreSQL primary has a synchronous standby in another zone, managed by a tool like Patroni, so a zone loss needs at most an automatic promotion. Caches either run per zone or tolerate losing a third of their nodes, which means the database must survive the extra misses.
5Detecting a Gray Failure
Total zone failures are easy to see. The harder case is gray failure: a zone that half works, such as packet loss on some links or a slow storage system. Instances there often still pass simple health checks, because a check that returns 200 from a local endpoint does not exercise the broken path.
The best detector is comparison. We measure error rate and latency per zone and compare each zone with the others. If zones A and B show 0.1 percent errors and zone C shows 4 percent, C is the outlier, even if every health check is green. An alert, or automation for clear cases, then triggers evacuation. Because the request path is zone-contained, the per-zone metrics are clean; with cross-zone hops, every zone would look equally bad.
- Compare error rate and latency per zoneevery minute
- One zone a clear outlier?for example 4% errors vs 0.1%YesEvacuate that zoneNoKeep watching
- Flip the evacuation flagone pre-tested action
- Traffic drains in about 30 ssurvivors already provisioned
- Diagnose with no customer impactrestore when healthy
5 steps in order. Play them, or step through them one at a time.
6Make Evacuation Routine
An evacuation path that is used once a year will fail when needed. So we practise it in production regularly, for example evacuating one zone for an hour every month during normal traffic. Each drill measures how long the drain takes and records anything that breaks, such as a service that ignored the flag or a cache that was only in one zone, and each finding becomes a defect to fix.
The cultural rule follows: evacuate first, diagnose later. When a zone looks wrong, the on-call engineer shifts traffic away without needing to know the cause, because the action is safe, fast and reversible. The investigation then happens without customers watching.
7Follow-up questions
What do you do with the database primary if it sits in the zone being evacuated?
We move it out before or as part of the evacuation. With a synchronous standby in a healthy zone, a controlled switchover through Patroni or the managed database's failover promotes the standby with no data loss and a pause of seconds to a minute. If the zone is failing badly, automatic failover does the same. The evacuation runbook should include this step and the drill should exercise it, because traffic shifted away from the zone still crosses into it for every write until the primary moves.
Why not let health checks alone handle zone failures?
Simple health checks miss gray failures and react instance by instance. A zone-level switch is decisive and catches what per-instance checks miss, while health checks still handle single instance failures.
Does zone affinity cause uneven load?
It can if traffic enters zones unevenly. The load balancer should spread incoming traffic evenly across zones, and autoscaling or capacity planning keeps each zone sized for its share.
8Conclusion
In this answer, we designed a payments platform where a degraded zone can be removed quickly and safely: requests stay inside one zone through zone-aware routing, one evacuation switch shifts traffic through health checks rather than control plane calls, the other zones are pre-provisioned and stateful systems span all three zones, per-zone comparison catches gray failures, and regular production drills make evacuation routine.
Open with
The core problem is that requests cross zones at every hop, so a sick zone touches most requests: with three random hops, about 70 percent of requests hit any given zone.
Then, if they want more
So my first rule is zone affinity. The load balancer spreads traffic across zones, and from there every hop prefers the same zone, using topology-aware routing or trafficDistribution PreferClose in Kubernetes and zone-preferring client load balancing, crossing zones only for the database primary or when a local dependency is unhealthy.
Then I would build one evacuation switch, a single pre-tested action that removes a zone from the load balancer and all service routing.
Its state lives in the data plane, for example a replicated flag that health checks in that zone read, so evacuation just makes those checks fail and existing mechanisms drain traffic, with no API calls that create or delete resources during the event.
The two remaining zones are pre-provisioned to carry peak, quorum systems have a member in each zone, and PostgreSQL has a synchronous standby in another zone so the worst case is an automatic promotion. To catch gray failures that pass health checks, I compare error rate and latency per zone and treat a clear outlier as a reason to evacuate.
Finally, we practise evacuation in production regularly, measure it, and adopt evacuate first, diagnose later as the default response.
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 the platform so that a degraded zone can be taken out of service quickly and...": https://scrivio-interview-library.netlify.app/architecture/high-availability/7161f63172/