← all cheat sheets
FUNDAMENTALS · MECHANISM WALKTHROUGH

DR Failover
System by System, Primary to Secondary

every DR plan hangs on two numbers — RTO and RPO — and the single riskiest moment in the entire process is the instant the secondary database is promoted to writable.
TRIGGER / DECISION DATABASE PROMOTION APPS START AT DR SITE DNS/GSLB CUTOVER CLIENTS RECONNECT VALIDATE USERS RESTORED FAILBACK (LATER, PLANNED)
01 The Full Sequence — Worked Example
1

The Trigger and the Decision

The primary site suffers a genuine outage — power failure, disaster, or an incident severe enough to cross the DR threshold. Monitoring detects primary is unreachable or degraded beyond a defined limit, and a human incident commander formally declares a disaster and authorizes failover. This decision is deliberate, not automatic reflex — failing over (and eventually back) is itself a real operational risk, not a free action.

Trigger
2

RTO and RPO Set the Frame

Every DR plan is built around two numbers, defined long before any incident: RTO (Recovery Time Objective — how long can the business tolerate being down) and RPO (Recovery Point Objective — how much data loss, measured in time, is acceptable). These two numbers dictate how much of what follows can be pre-automated versus done manually under pressure, and how "clean" this failover can realistically be.

RTO / RPO
3

Checkpoint — Database Promotion, the Riskiest Single Step

The secondary site's database — replicating from primary, synchronously or asynchronously — is promoted from standby/read-replica to the new writable primary. If replication was asynchronous and lagging at the moment of failure, any transactions not yet replicated are gone the instant this promotion happens. This exact loss is what RPO quantifies in advance — it isn't an accident, it's a planned, bounded trade-off.

Checkpoint
4

Data Consistency Check

Ideally, automated tooling verifies replication lag and data integrity immediately before or after promotion. Under genuine crisis time pressure, this step can be compressed or skipped — a real, acknowledged operational risk that good DR runbooks explicitly plan for rather than pretend won't happen.

Verify
5

Applications Start at the DR Site

Application servers at the secondary site — possibly sitting in a scaled-down standby state — are started or scaled up to production capacity, with configuration now pointing at the local (secondary) database connection instead of primary's.

App Startup
6

DNS / GSLB Cutover

Global traffic management — DNS-based failover or a GSLB appliance — updates so the public hostname now resolves to the secondary site's IP. This is not instantaneous for every client: DNS caching means some users see the switch immediately while others, depending on their resolver's cached TTL, don't see it until that TTL expires.

DNS Cutover
7

TTL Is a Planning-Time Decision, Not an In-Event Fix

A low TTL configured on these records well ahead of time — as part of DR planning, not during the event — is what keeps this cutover fast for most users. If TTL was left high, failover could effectively take hours to reach some users regardless of how quickly every other system recovered, and there's nothing to be done about it mid-incident.

TTL
8

Clients Reconnect

As DNS propagates, new client connections land on the secondary site. Existing sessions to the now-dead primary are simply lost — the same as any hard network failure — and must reconnect fresh, this time resolving to the new address.

Reconnect
9

Dependent Systems Have Their Own Reconnection Needs

Message queues, caching layers, other internal microservices, and third-party integrations with IP allowlists each need their own reconnection or reconfiguration — some may need manual intervention if they were hardcoded to primary's IP rather than using the same DNS-based approach the public-facing service uses.

Dependencies
10

Validation — Not Just "Servers Are Up"

The DR team runs a defined set of smoke tests and health checks against the secondary site's actual production-serving stack — real transactions, real data reads/writes — before formally declaring the failover complete. "The servers responded to a ping" is not the same claim as "the service is genuinely healthy."

Validate
11

Users Restored — Possibly at Reduced Capacity

End users regain service, though sometimes at somewhat reduced capacity if the secondary site was deliberately sized for standby rather than full production load — a common, intentional cost trade-off made at DR-design time, not a failure of the failover itself.

Restored
12

Failback — Deliberately Unhurried

Once primary is repaired and independently verified healthy, a second, carefully planned cutover — usually scheduled during a low-traffic maintenance window, not run as an emergency — reverses the process: replicate data back to primary, re-promote it, re-point DNS. Failback is intentionally not rushed the way the initial failover often had to be, precisely because it isn't an active emergency.

Failback
02 How to Explain This in an Interview
03 Follow-Up / Gotcha Questions
Q What's the actual difference between RTO and RPO?
A RTO answers "how long can we tolerate being down" — it's a time-to-recovery target. RPO answers "how much data can we afford to lose" — measured in time, e.g. an RPO of 15 minutes means at most 15 minutes of transactions can be lost, which directly dictates how frequently replication or backups must occur.
Q Why is database promotion the riskiest single step in the whole process?
A It's the point where any gap between the primary and secondary's data state becomes permanent and irreversible — once the secondary starts accepting new writes as the primary, whatever it was missing from the old primary is gone for good. Every other step in a DR failover is largely mechanical; this one has genuine, unrecoverable consequences if replication was behind.
Q Why doesn't DNS failover happen instantly for every user?
A DNS answers are cached by resolvers for the duration of the record's TTL, and different clients query at different times with different cached copies — some see the new IP within seconds, others not until their specific cached TTL expires. This is exactly why DR-critical DNS records are typically configured with a low TTL well in advance, so the eventual cutover is fast for nearly everyone.
Q What happens to systems that were hardcoded to the primary site's IP instead of using DNS?
A They don't fail over automatically at all — someone has to manually identify and reconfigure them during the event, which is slower and more error-prone than a DNS-based approach. This is a common, real gap DR runbooks specifically try to catch ahead of time through dependency mapping, precisely because it's easy to miss during the actual pressure of an incident.
Q Why is failback typically much slower and more deliberate than the original failover?
A The original failover is often reactive, under real time pressure, with the business actively down. Failback happens once the business is already stable and running on the secondary site — there's no emergency forcing speed, so it's scheduled for a low-traffic window and executed carefully, specifically to avoid introducing a second outage while "fixing" the first one.
Q What's the difference between a DR test/drill and an actual DR failover?
A A drill validates the same mechanism — replication, promotion, DNS cutover, application startup — but typically in an isolated or non-production-impacting way, and on a planned schedule with rollback already prepared. A real failover carries genuine production risk, real user impact, and no guaranteed rollback if something doesn't work as expected — which is exactly why regular drilling matters: it's the only way to find the gaps before they're discovered during an actual emergency.
04 Quick-Fire Glossary
TermMeaning
RTORecovery Time Objective — the target maximum duration of an outage
RPORecovery Point Objective — the target maximum acceptable data loss, measured in time
Synchronous ReplicationWrites are confirmed at both sites before being acknowledged — zero data loss, at a latency cost
Asynchronous ReplicationWrites are confirmed at primary and replicated to secondary afterward — some replication lag/risk
GSLBGlobal Server Load Balancing — DNS-aware traffic steering across geographically separate sites
TTLHow long a DNS answer may be cached — directly controls how fast a DNS-based failover actually propagates
Warm / Hot StandbyA DR site kept partially or fully running/scaled, versus a cold site requiring a full build-out to activate
Smoke TestA quick set of real functional checks confirming a system is genuinely healthy, not just reachable
FailbackThe planned, deliberate reverse cutover back to the original primary site once it's repaired
DR RunbookThe documented, step-by-step procedure a team follows to execute a failover consistently under pressure