Consistency Guarantees Playbook (Linearizability, Serializability, Snapshot Isolation, Session Guarantees)

2026-02-27 · software

Consistency Guarantees Playbook (Linearizability, Serializability, Snapshot Isolation, Session Guarantees)

Date: 2026-02-27
Category: knowledge
Domain: distributed systems / data infrastructure

Why this matters

Teams often ask for “strong consistency” without specifying which guarantee they actually need.

That ambiguity causes expensive mistakes:

This playbook is a practical map for choosing the minimum sufficient guarantee.


The core distinction most people miss

Two axes are different but frequently conflated:

  1. Single-operation real-time ordering (e.g., linearizability)
  2. Multi-operation transaction isolation (e.g., serializability)

You can have one without the other.


Quick definitions (operator-grade)

1) Linearizability (single-object, real-time)

If operation A completes before operation B starts, then B must observe A’s effect.

Use when:

2) Serializability (transactional, multi-object)

Concurrent transactions must be equivalent to some serial order.

Use when:

3) Strict serializability (a.k.a. strong/external consistency)

Serializability plus real-time ordering.

Think: transaction-level correctness + linearizability-style real-time constraint.

Use when:

4) Snapshot isolation (SI)

Each transaction reads from a snapshot and commits if no write-write conflict.

Use when:

5) Session guarantees (client-centric consistency)

Per-session guarantees such as:

Use when:


Anomaly checklist (what each level can still allow)

Rule of thumb:

If your invariant is “at most one on-call doctor”, SI can fail (write skew).
If your invariant is “every transfer preserves total funds”, serializable+ is usually required.


Product mapping (practical, simplified)

PostgreSQL

Azure Cosmos DB

Offers five levels: Strong, Bounded Staleness, Session, Consistent Prefix, Eventual.

DynamoDB

Spanner


Decision matrix (fast pick)


Design pattern: layered consistency

Most real systems should not use one consistency mode everywhere.

Pattern:

  1. Critical write path: Serializable or strict-serializable transaction domain
  2. User timeline/profile reads: Session guarantees
  3. Analytics/search/feed: Eventual/consistent-prefix materialized views
  4. Cross-boundary operations: Outbox + idempotency + reconciliation jobs

This gives correctness where required and speed where affordable.


Verification playbook (before production)

  1. State invariants explicitly
    • e.g., “inventory never negative”, “one active subscription per user”.
  2. Map each invariant to required guarantee
    • don’t select by vendor marketing terms.
  3. Run concurrency tests with adversarial schedules
    • include retry storms, delayed replicas, clock skew, failover.
  4. Test user semantics, not just DB semantics
    • read-your-writes after redirect, mobile reconnect, region failover.
  5. Monitor anomaly indicators
    • unique-constraint retries, invariant-repair job volume, reconciliation drift.

Common failure patterns

  1. “Strong consistency” hand-waving
    • no formal guarantee named in design docs.
  2. Relying on SI for invariant-heavy workflows
    • then discovering write skew in production.
  3. Ignoring client/session behavior
    • backend is correct, UX still appears broken due to stale read path.
  4. Mixing regions without consistency intent
    • accidental cross-region stale reads after writes.
  5. No explicit compensation/reconciliation loop
    • edge anomalies accumulate silently.

One-page policy template


References (researched)