advanced

Strong consistency

Require latest committed state when invariants such as balances, seats, or permissions cannot tolerate stale reads.

Strong consistency (linearizability or serializability) ensures reads reflect the latest committed write. Required when invariants are strict: account balances, inventory counts, seat reservations, permission grants. Implementation uses single leader writes, quorum reads with versioning, or distributed transactions with acceptable latency cost.

Not every entity needs strong consistency — apply it where incorrect stale reads cause financial or safety bugs. Document which APIs are strongly consistent versus eventually consistent.

On interviews: identify two entities in the prompt needing strong consistency and which can be eventual, with storage choice justification.

Common pitfalls: strong consistency everywhere killing latency; reading from async replica for balance checks; distributed transactions without failure analysis.

Checklist:

  • List invariants requiring latest state.
  • Route critical reads to authoritative source.
  • Use transactions or compare-and-set where needed.
  • Accept latency cost explicitly.