download

Which failover topology meets RPO 60s, RTO 5m, and 50ms writes?

System design~15 minReviewed 3 Dec 2026Free · No sign-in

Question

Your checkout service runs in us-east, with disaster recovery in us-west. Cross-region round-trip latency (RTT) is 85 ms, and a local database commit takes 15 ms.

You must meet three hard targets at sensible cost:

  • RPO <= 60 s (max committed data lost)
  • RTO <= 300 s (5 minutes max downtime)
  • Checkout write p95 <= 50 ms during normal operation
  1. Compare Backup & Restore, Pilot Light, Warm Standby, and Synchronous Active-Active against all three limits. Which topology wins?
  2. How do you prevent split-brain writes during failover, and how do you prove the 5-minute RTO holds?
Show hints (3)
  1. "CHECK RTT MATH"

    Synchronous cross-region commits wait for at least one 85 ms RTT plus 15 ms local work. Compare 100 ms against the 50 ms write SLA.

  2. "COMPARE COLD BOOT TIMES"

    Backup & Restore and Pilot Light both keep normal writes at 15 ms, yet restoring backups or cold-booting compute takes well over 300 s.

  3. "FENCE BEFORE PROMOTE"

    Before us-west takes writes, revoke us-east's lease or epoch token so a partitioned old primary cannot keep accepting orders.

Show checked explanation

Choose Warm Standby with async cross-region replication (~10 s lag), a live scaled-down app fleet in us-west, and automated lease-fenced promotion (~120 s RTO). Normal writes stay at 15 ms (inside 50 ms). Backup & Restore misses RPO and RTO, Pilot Light misses the 300 s RTO, and Synchronous Active-Active hits 100 ms writes (2x the 50 ms limit).

"SOLUTION · PYTHON"
MAX_RPO, MAX_RTO, MAX_WRITE_MS = 60, 300, 50
LOCAL_MS, RTT_MS = 15, 85

# (topology, rpo_s, rto_s, sync_cross_region)
topologies = [
    ("backup_restore", 300, 1800, False),
    ("pilot_light", 10, 720, False),
    ("warm_standby", 10, 120, False),
    ("sync_active_active", 0, 15, True),
]

for name, rpo, rto, is_sync in topologies:
    write_ms = LOCAL_MS + (RTT_MS if is_sync else 0)
    ok = rpo <= MAX_RPO and rto <= MAX_RTO and write_ms <= MAX_WRITE_MS
    tag = "MEETS_ALL" if ok else "FAIL"
    print(f"{name:18} RPO={rpo:3d}s RTO={rto:4d}s"
          f" write={write_ms:3d}ms -> {tag}")
"OUTPUT"
backup_restore     RPO=300s RTO=1800s write= 15ms -> FAIL
pilot_light        RPO= 10s RTO= 720s write= 15ms -> FAIL
warm_standby       RPO= 10s RTO= 120s write= 15ms -> MEETS_ALL
sync_active_active RPO=  0s RTO=  15s write=100ms -> FAIL

Author-checked on CPython 3.12.10: ran the DR topology constraint evaluator, checked RPO, RTO, and RTT latency margins, and simulated epoch fencing against split-brain writes. Checked by an editor other than the author.

Walkthrough

The physics of an 85 ms cross-region RTT plus a 300 s RTO narrows four textbook options down to one.

TopologyRPO (<=60s)RTO (<=300s)Write p95 (<=50ms)Relative cost
Backup & Restore300 s (fail)1,800 s (fail)15 ms$
Pilot Light10 s720 s (fail)15 ms$$
Warm Standby10 s (pass)120 s (pass)15 ms (pass)$$$
Sync Active-Active0 s15 s100 ms (fail)$$$$

Why three options fail:

  • Backup & Restore archives WAL every 5 minutes (300 s RPO) and needs ~30 minutes (1,800 s) to provision, restore, and replay.
  • Pilot Light streams async WAL (~10 s lag, meeting RPO), yet app servers sit scaled to zero. Booting instances, warming connection pools, and shifting traffic takes ~12 minutes (720 s), missing 300 s.
  • Synchronous Active-Active hits 0 s RPO and 15 s RTO. Yet every write waits for an 85 ms cross-region RTT (15 + 85 = 100 ms), breaking the 50 ms write SLA by 2x at the highest cost.

Why Warm Standby wins. Async streaming replication stays off the write path, keeping normal writes at 15 ms while holding typical lag to 5-15 s (50 s RPO margin at 10 s lag). A scaled-down app fleet and standby DB already run in us-west. Failover takes 120 s (30 s lease expiry + 45 s fencing and DB promotion + 45 s DNS/anycast shift and autoscaling), leaving 180 s of RTO headroom.

Preventing split-brain with fencing. A network partition can make us-east look dead while clients still reach it. Use a consensus-backed primary lease with a monotonic epoch number (epoch = 1 -> 2). Before us-west opens for writes at epoch = 2, wait for us-east's lease to expire and fence us-east (revoke write proxy routing and storage epoch). Any late write carrying epoch = 1 is rejected.

Proving RTO with drills. An untested failover plan breaks on stale DNS TTLs, missing IAM secrets, or cold caches. Run scheduled failover and failback game days on a realistic load, time every step against 300 s, and measure actual replication lag.

Common mistakes

  • Picking Synchronous Active-Active for 0 s RPO without checking speed-of-light RTT. An 85 ms cross-region round trip makes a 50 ms write SLA impossible.
  • Promoting us-west on a single failed health check without fencing us-east. Both regions then accept writes during a partition, causing split-brain orders that cannot merge cleanly.
  • Setting DNS TTL to 300 s or higher on the failover endpoint. Stale resolvers keep sending traffic to the dead region and blow the entire 300 s RTO budget.
  • Never testing failback to us-east. Reversing replication without wiping diverged local WAL from the crashed old primary can corrupt or drop new orders.

Follow-up questions

  • "How do you handle the 10 seconds of locally committed writes not yet replicated to us-west when us-east dies?" Accept that async replication trades up to 10 s of data loss for 15 ms writes. If us-east storage later comes back, inspect its diverged WAL offline and reconcile unshipped payments against payment-processor records rather than re-attaching the old primary blindly.
  • "What if the business later demands RPO = 0 s AND 50 ms writes?" You cannot beat 85 ms RTT across distant regions. Move the sync quorum into three nearby availability zones (< 5 ms RTT) inside one metro region, or partition customers by home region so each user's writes commit synchronously within nearby zones.
  • "Why do we need a third region or witness for automated failover?" With only two regions, neither side can tell whether the other died or the link between them snapped. A lightweight witness in a third region gives 2-of-3 quorum so only the majority side can grant the new primary lease.

What a strong answer covers

Proves why Backup & Restore, Pilot Light, and Sync Active-Active (100 ms vs 50 ms) each fail a hard limit. Selects Warm Standby (10 s RPO, 120 s RTO, 15 ms writes), adds epoch fencing against split-brain, and requires timed failover drills.

Open in interactive practice deck →

Original OfferVibe question. AWS: Disaster Recovery Options in the Cloud · AWS Well-Architected: Plan for Disaster Recovery · Google Cloud: Disaster Recovery Planning Guide · PostgreSQL: Warm Standby Servers · Google SRE: Managing Critical State.
© 2026 OfferVibe · Text CC BY-NC-SA 4.0 · code MITFree to share and adapt with credit, not for commercial use. Code samples are free for any use.