Skip to content
WebsiteHosting.com

comparison Hosting

Multi-region hosting failover versus data consistency

A replacement site can be reachable and still be five writes behind. Compare what the replica can recover, who can write next, and whether clients have actually reconnected.

Latest recorded source check · P0123

What it means

Changing DNS can direct clients to a replacement site, but it does not copy the writes that site is missing. To judge a failover, you need to know which writes the replacement can recover, whether the old site can still accept writes, and whether clients can reach the replacement. An endpoint change alone answers none of those questions.

Try it

Simulation — the old site has acknowledged write 100, meaning it told the client that write 100 succeeded. The replica has durably stored writes only through 95. Start with Old writer fenced and Endpoint switch both set to yes, and Required scenario evidence set to provided. The result is lag: the endpoint has switched in the example, but five acknowledged writes are absent from the replica.

Multi-region hosting failover versus data consistency

Show why choosing a new site endpoint does not guarantee up-to-date writes

Simulation
Modeled outcome: Lag

Replica lacks acknowledged sequence(s) even if routing switches.

Multi-region hosting failover versus data consistency: synthetic scenario inputs
Replaces all inputs with the documented starting example and the indicated change. Reset restores the starting example.
History, authority and endpoint

Independent conditions

  1. Missing acknowledged writes5
  2. Old writer fencedyes
  3. Endpoint switchyes
  4. Client reconnectNot observed
Acknowledged sequence100 writes
Replica durable sequence95 writes

Sequence counts are not seconds. An endpoint switch does not establish client recovery or exclusive write authority.

Evaluated inputs

Required scenario evidence
provided
Replica durable sequence
95 count
Last acknowledged sequence
100 count
Endpoint switch
yes
Old writer fenced
yes

Ordered contiguous synthetic write sequence; no unacknowledged writes, actual replication protocol, DNS convergence or failover instructions.

About this model

The controls set only a local, bounded scenario. The computed branch is not a verdict about a live system. Inputs listed as not evaluated did not participate in this branch after validation.

Reset restores the original inputs. It does not change the open or closed state of help or FAQ answers.

  1. Change only Endpoint switch to no. The reported endpoint setting changes; the gap does not. Writes 96 through 100 are still missing.
  2. Set the switch back to yes, then raise Replica durable sequence from 95 to 100. The gap falls to zero. With the old writer fenced, the result becomes ready.
  3. Leave both sequences at 100 and change Old writer fenced to no. The result becomes unsafe. Even a complete copy of the acknowledged history does not prevent the old writer from accepting the next write.

Reset restores the starting example. This is a local comparison, not a check of either site. Do not promote a replica or change a real endpoint on the strength of ready.

What the five-write gap tells you

The example numbers writes consecutively, without gaps. The replica’s recovery point is write 95: it can recover everything in this history up to and including 95. Subtracting that position from the last acknowledgment gives 100 − 95 = 5 missing writes, not five seconds of delay. It establishes that those writes are absent from this copy, not that they have been lost everywhere.

That distinction matters with asynchronous replication. PostgreSQL 18, for example, documents a window in which a primary can fail before its write-ahead log has been shipped to the standby. Transactions already acknowledged on the primary can then be missing after failover. Sending clients to the standby changes the destination, not the log it received.

Fencing answers a different question: can the old writer’s writes still take effect? Without an enforced boundary, the old and new sites could both accept writes and build different histories, a problem called split brain. Directing clients elsewhere is not a fence. One example of enforcement is a storage service that rejects an old writer’s token after it has processed a newer one. The simulation takes fencing as an input; it does not implement or verify it.

Set the replica position to 100 and old-writer fencing to no. The gap is now zero, but the result is unsafe: the model has accounted for the acknowledged history without establishing exclusive write authority. The endpoint switch cannot repair that missing authority.

If the replica is known to be at 95 but fencing is unknown, the five-write gap is still known. The result is unknown because write authority is unresolved. If the replica position itself is unavailable, use Required scenario evidence: missing rather than guessing a position. With otherwise valid inputs, the simulation then reports insufficient and calculates no gap. An unknown recovery point is not a gap of zero.

In practice

When reviewing a recovery timeline, record the evidence for each milestone separately. The starting example supplies positions and settings, not timestamps or live observations.

Milestone to recordWhat the starting example establishes
Replica covers the acknowledged historyNot yet: durable through 95, acknowledged through 100.
Old writer can no longer writeFenced by assumption; not independently verified.
Endpoint changes destinationSwitch set to yes; DNS convergence is not measured.
Client reconnects to the replacementNot observed; there is no client in the simulation.

For a concrete distinction between the last two milestones, Amazon RDS Multi-AZ DB instance failover changes the DNS record, but clients still need to reestablish their connections. A record change is not a client reconnect time.

Even ready describes only the replica’s acknowledged history and the assumed fence; it can appear with Endpoint switch set to no. When a recovery report says “failover complete,” look for the last recoverable write, evidence that only one writer can make changes, and a client observation from the replacement. If one is missing, leave that part of the conclusion open.

Frequently asked questions

Editorial questions based on the listed sources and explicitly labeled local examples.

Can acknowledged writes be lost?

Yes. If a primary acknowledges a write before asynchronous replication has made its WAL available to the recovery target, failure of that primary can leave the promoted replica without the write.

Does zero lag prove safe promotion?

No. A replica can cover the acknowledged history while the old writer still has effective write access. Verify exclusive authority separately, then establish actual consistency and client recovery; this bounded model supplies those conditions as assumptions.

Is endpoint switching instantaneous?

No. An Amazon RDS Multi-AZ failover, for example, changes the DNS record and requires clients to reestablish connections. Client recovery can lag database promotion. Measure those observations separately rather than assuming an instantaneous endpoint switch.

Is RPO the same as recovery time?

No. Recovery point concerns the recoverable data state and potential data loss; recovery time concerns the duration of service recovery. This lab exposes missing acknowledged writes separately from recovery delay; one does not determine the other.

Sources & model boundaries

Primary references used for this explanation. The interactive example is an educational model, not a live check.

  1. PostgreSQL log shipping and streaming replication

    log shipping and failover. An asynchronous replica may lack WAL after catastrophic primary failure. Synchronous acknowledgment and replay visibility depend on the configured mode.

    Checked .

  2. How to do distributed locking (author analysis)

    resource tokens. Increasing tokens allow a cooperating resource to reject requests older than a token already processed; lease expiry alone does not enforce this.

    Checked .

  3. Amazon RDS Multi-AZ failover

    Failover process. Amazon RDS Multi-AZ failover changes the DNS record and requires clients to reestablish connections. Database promotion and client recovery are distinct observations.

    Checked .

Report an issue. Include the article URL and ID, not passwords or access keys.