Copies, lag, leaders, and agreement
Picture
A leader accepts a write and replicas receive it. If copying is asynchronous, a replica may temporarily show the old value.
Predict
Does reading from any asynchronous replica always provide read-your-writes?
Walk through the small example
No. The chosen replica may not have received your latest write yet.
Mental model and runnable Python model
Replication can improve durability, read capacity, and availability, but introduces lag and failover questions. Distinguish leader-based replication, multi-leader conflict resolution, and leaderless protocols rather than merging their guarantees. A majority intersection argument is necessary in many protocols but is not sufficient for linearizability by itself; epochs, log ordering, committed-version rules, and recovery matter. Raft is a primary example of replicated-log consensus. Backups serve a different purpose: replicated accidental deletion can reach every live copy.
What the function promises: The Python model demonstrates set intersection only. It is explicitly not a quorum database, election algorithm, or consensus implementation.
from itertools import combinations
def every_read_intersects_write(n, reads, writes):
nodes = range(n)
return all(set(r) & set(w)
for r in combinations(nodes, reads)
for w in combinations(nodes, writes))
assert every_read_intersects_write(3, 2, 2)
assert not every_read_intersects_write(3, 1, 2)
Work and storage: This exhaustive teaching model is combinatorial and only for tiny n. Real protocols do not enumerate quorum subsets.
When to recognize it: A read quorum and write quorum may intersect. That alone does not define ordering, leadership, version selection, or safe behavior during failures.
Check before applying it: Quorum overlap and replication alone do not establish a complete consistency or recovery guarantee.
Change one rule
A buggy delete is copied to every replica. Have replicas replaced backups?
See what changes
No. Independent recovery history, retention, and tested restore procedures are needed. Replication can faithfully reproduce a mistake.
Connect
Choose storage from reads and writes: Copies must preserve the database’s promised write behavior.
Ask which version a read is allowed to see: Choose exactly which read versions and partition behavior are acceptable.