ARC 2Choose Consistency SemanticsChapters 5โ€“9

Arc 2 Recap โ€” Choose the Right Consistency Semantics (Chapters 5โ€“9)

Arc 2 establishes a collection-selection process based on business invariants, failure windows, and validation methods.

What this arc established

Capability matrix

Business invariant Collection During a partition After recovery Validation focus
one current hint Register nodes may see different values deterministic winner reversed order agrees; stale fallback
time-bounded exclusive right to act Lease old holder may still run new token identifies the valid owner external resource rejects old token
multi-node local updates merge safely CRDT local state is incomplete states converge after merge commutativity, associativity, idempotence
transactional fact or reliable history keep outside DSM as primary storage local success may be irreversible convergence cannot compensate effects transaction, idempotency, audit, replay

How this arc realizes DSM's value

Register, Lease, and CRDT provide reusable coordination semantics for three recurring problem shapes. The value appears only when a collection matches the business invariant. The service team still records partition consequences, fencing responsibilities, and the authoritative source.

Five review questions

  1. Which system owns the authoritative state?
  2. Can lost state be recovered from a peer or rebuilt from that authority?
  3. May both nodes succeed during a partition?
  4. How do fencing, idempotency, or transactions protect external effects?
  5. Which executable command proves the selected semantics rather than compilation alone?

Common mistakes

Mistake Correction
model a Lease with a Register include TTL, transfer, and external fencing in the contract
wrap any object in a CRDT establish algebraic properties for the business merge first
read time or randomness in a resolver keep it pure and deterministic; reverse inputs to check commutativity
test only the happy path inject an old token, duplicate delta, changed order, and partition candidates

Migration exercise

Choose storage semantics for remaining coupon quantity, batch-worker ownership, and page-view counts. For each DSM choice, record the failure window. For each rejection, name the needed transaction or history guarantee. Selecting DSM for all three earns no special credit.

Next

Arc 3 decomposes "eventual consistency" into member views, online propagation, missed-update detection, and repair.