Roles of a Primary and a Replica

A service can designate an instance to accept writes and other instances to copy state, according to a defined protocol.

Source
Anbloq
Language
English
Created
Updated
Chapters
4
Reading time
1 min
In this article4 chapters
  1. Trace one update
  2. Handle the transition of responsibility
  3. Trace where versions are accepted and observed
  4. Read failover guarantees from the specific system

Trace one update

The primary can record a new catalogue entry and later propagate it. A replica can serve an older snapshot until that copy catches up. Replica reads describe what a caller can observe.

Handle the transition of responsibility

If the primary is unavailable, choosing a replacement requires knowledge of replicated progress and which instance may accept writes. See primary–backup failover.[1]

Trace where versions are accepted and observed

In a single-primary example, a client writes version seven through the designated primary. A replica receives that update and may serve reads according to freshness rules. A successful read by a replica does not prove it has applied the latest version. See replica reads after writes.

Client writes → primary accepts v7
Replication carries v7 → replica applies
Read on a copy can observe v6 during the gap

Read failover guarantees from the specific system

Choosing a new writer requires rules that prevent incompatible ownership. Replicas also differ in how they acknowledge changes. Test confirmed writes and observable reads under the configured durability and freshness policy.

References

  1. Google, Site Reliability Engineering ↩