Scrivio Interview library
DesignAdvanced6 min read · updated 12 November 2026

Leadership wants the product to survive the loss of an entire cloud region with under 5 minutes of downtime and no lost payments. Design the database layer and explain where you would push back.

No lost payments across a region loss means a payment must be committed in at least two regions before we confirm it, either with a consensus-based store across three regions or a synchronous cross-region standby, and that adds tens of milliseconds to every such write. I would apply that only to payments, for example a distributed SQL store across three regions, while other data uses asynchronous replicas with automated promotion that meet the 5-minute RTO but can lose seconds of data, reconciled with the payment provider afterwards. I would push back on applying the strictest target to everything, insist that Kafka, caches, secrets and DNS fail over too, and require regular region failover exercises as proof.

Why this question is asked

Requirements like this usually arrive as one sentence from leadership, and they are reasonable goals. The trouble is that their cost is very uneven: surviving a region with five minutes of downtime is moderately expensive, while losing nothing at all across regions changes how every write works. A senior engineer's job is to show leadership what each part costs and to deliver the part that matters. Interviewers ask this to see whether we can design it and also say no to the right things. In this answer, we will translate the targets, see why zero loss forces synchronous cross-region commits, design the payments tier and the rest, cover the parts beyond the database, and explain where and how to push back.

1Translating the Targets

Under 5 minutes of downtime is an RTO, a recovery time objective: from the moment a region is lost to the moment customers can pay again. No lost payments is an RPO, a recovery point objective, of zero for payment records: every payment we confirmed must still exist afterwards.

Losing a region is different from losing a server or a zone. Everything in that region is gone at once: databases, Kafka, caches, secrets stores, load balancers and possibly the control plane we would use to fail over. So the design has to work from the surviving regions alone, without any help from the failed one.

2Why Zero Loss Means Synchronous Cross-Region Commits

If we confirm a payment once it is committed in us-east, and us-east disappears a millisecond later, the payment exists nowhere else. The only way to guarantee RPO zero is that the commit waits until the payment is durable in another region too. With PostgreSQL, that is a synchronous standby in a second region. With a consensus database, it is a majority of replicas that spans regions.

That wait costs a cross-region round trip on every payment write, roughly 10 to 30 ms between nearby regions on one continent and 70 ms or more across an ocean. For a payment request that already takes 200 ms through fraud checks and card networks, adding 20 to 40 ms is usually acceptable. Applying it to every write of every product is a different matter, which is the heart of our pushback later.

3Option A: Distributed SQL Across Three Regions for Payments

A consensus-based database such as CockroachDB, YugabyteDB or Spanner, with replicas in three regions, commits each write once two of three regions have it. Losing any one region leaves a majority, so the database keeps working without any promotion step and without losing a single acknowledged commit. RTO becomes the time for clients to reconnect, often well under a minute.

The cost is a new database for the payments service, consensus latency on every write, and three regions of infrastructure. Because it is only the payments tier, the data is small enough that this is affordable. A synchronous PostgreSQL standby in a second region is the alternative with familiar technology, but it needs a failover manager that can safely promote across regions and a third location to break ties, so in practice it ends up with similar complexity.

Step throughTiered database design for a region loss
  1. Payments: distributed SQL, 3 regionsRPO 0, RTO under 1 min, +20 to 40 ms per write
  2. Orders and accounts: PostgreSQL + async cross-region replicaRPO seconds, RTO under 5 min via automated promotion
  3. Catalogue, search, analytics: rebuildableRPO minutes to hours, restore or rebuild
  4. Shared: Kafka, caches, secrets, DNSeach with its own regional failover

4 layers, from the top down. Step through them one at a time.

Only the payments tier pays for synchronous cross-region commits.

4Option B: Asynchronous Replicas for Everything Else

For the rest of the data, an asynchronous replica in a second region, with automated promotion when the primary region is declared lost, meets the 5-minute RTO comfortably. The catch is that it can lose whatever had not replicated yet, typically a few seconds of writes.

For non-payment data that is often fine. And there is a useful trick for payments too, if the business will not accept option A: the external payment provider has its own record of every charge. After a regional failover, a reconciliation job compares the provider's transactions for the last few minutes with ours and recreates any missing records. It is not RPO zero in our database, but no customer's payment is lost from the business's point of view. That can be a much cheaper way to meet the real requirement, and I would present it as an alternative.

5Everything Else in the Region Must Fail Over Too

Databases are only one part. If the payments database survives but Kafka was only in us-east, the payment events are gone. If the secrets manager or the key management service was regional, the surviving services cannot decrypt their configuration. If DNS failover depends on a health check hosted in the failed region, it never triggers. Each of these needs its own cross-region plan: Kafka mirrored with MirrorMaker 2 or a stretched cluster, replicated secrets and keys, caches that can start cold, and global DNS or a global load balancer with health checks from outside any one region.

The 5-minute RTO is the time for all of this together, including the human decision to declare the region lost if that step is not automated.

6Where to Push Back, and How to Prove It

The first pushback is scope. Applying RPO zero and a 5-minute RTO to all data would put synchronous cross-region commits under every write and triple infrastructure for everything. Instead, we tier systems by business impact: payments get the strictest tier, orders and accounts the asynchronous tier, rebuildable data the cheapest. We bring numbers: the cost of each tier per year against the expected loss from a region outage, which for most systems is rare.

The second pushback is proof. A design that has never been exercised does not meet any target. We commit to region failover exercises, starting in staging and moving to production game days a few times a year, where we actually evacuate a region and measure RTO and data loss. The targets become real when we have measured them.

Step throughChoosing a tier for each system
  1. Is losing confirmed data unacceptable?
    YesPayments tier: consensus or syncNoNext question
  2. Must it be back within 5 minutes?
    YesAsync replica + automated promotionNoRestore or rebuild tier
  3. Prove it in a region exercisemeasure RTO and data loss

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

7Follow-up questions

Why not put a synchronous PostgreSQL standby in a second region?

It works for RPO zero, but if the second region or the link to it is down, writes stall in the primary region, and promoting safely across regions needs a quorum in a third location to avoid split brain. Once we add those, the setup is close in complexity to a three-region consensus database, while having worse availability.

How do you test a region failover without risking customers?

Start in a full staging environment, then run production exercises during low traffic with a clear abort plan, failing over one tier at a time. Many teams simulate the loss by blocking network access to the region rather than shutting things down, which makes recovery quicker if something goes wrong.

What about RTO for the decision itself?

If a human must declare the region lost, that alone can take ten minutes at night. Either automate the decision with outside health checks and clear criteria, or accept that the RTO includes the decision time and staff an on-call rotation that can make it fast.

8Conclusion

In this answer, we saw that no lost payments across a region loss requires synchronous cross-region commits, adding tens of milliseconds to each payment write, best delivered with a consensus store across three regions for payments only. Other data can use asynchronous replicas with automated promotion to meet the 5-minute RTO, payments can be reconciled with the provider as a cheaper alternative, every regional dependency must fail over too, and we push back on blanket targets while proving the design with regular region exercises.

What to say in the interviewAbout 90 seconds aloud

Open with

I would first split the requirement: under 5 minutes is the RTO, no lost payments is an RPO of zero for payment records. Zero loss across a region means a payment must be durable in a second region before we confirm it, so synchronous cross-region commits, roughly 20 to 40 ms extra per payment write on one continent.

Then, if they want more

For payments I would use a consensus database across three regions, like CockroachDB, YugabyteDB or Spanner, so losing one region leaves a majority and nothing acknowledged is lost, with no promotion step. Everything else gets asynchronous cross-region replicas with automated promotion: that meets 5 minutes but can lose seconds.

If the business does not want a new database, an alternative for payments is async replication plus reconciliation with the payment provider's records after a failover. I would also stress that the database is only one part: Kafka, caches, secrets and keys, and DNS all need their own cross-region failover, and the RTO includes the decision to fail over.

Then the pushback: I would not apply the strictest target to all data, because it puts cross-region latency on every write and multiplies cost. I would tier systems by business impact with costs for each tier, and I would insist we prove it with regular region failover exercises, measuring actual RTO and data loss.

About this answer

Last updated
12 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 documentation below. 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 "Leadership wants the product to survive the loss of an entire cloud region with under 5...": https://scrivio-interview-library.netlify.app/databases/replication-and-ha/da5b850f2b/