Skip to main content

Consistency Model Translation Drill

Translate vendor claims into client-visible contracts. Analyze a Jepsen-style history. The target skill is the honest reading of consistency marketing.

Retrieval Prompts

  1. Define linearizability in one sentence.
  2. State each of the four session guarantees.
  3. Define causal consistency.
  4. State PACELC in one line.
  5. Distinguish serializability from linearizability in one sentence each.

Part 1: Translate Vendor Claims

For each claim, translate it into a client-visible statement about what reads and writes are allowed to observe. Then classify it on the PACELC grid and on the linearizability / causal / session / eventual ladder.

Claim A (DynamoDB)

"By default, DynamoDB reads are eventually consistent. Optionally, you may request strongly consistent reads with ConsistentRead=true on most operations."

Translate:

  • What is the client contract for a default read after a write within the same session?
  • What is the client contract for ConsistentRead=true reads after a write within the same session? across sessions? during an AZ failure?
  • PACELC label for each mode.

Claim B (MongoDB)

"With readConcern: majority and writeConcern: majority, MongoDB provides linearizable reads on the primary."

Translate:

  • When is the claim actually linearizable? When does it degrade to "majority-committed but stale"?
  • What happens during a primary step-down?
  • What is the latency cost in a 3-AZ deployment?

Claim C (Cassandra)

"Cassandra provides tunable consistency. Use QUORUM on reads and writes for strong consistency."

Translate:

  • With RF=3, CL=QUORUM on read and write, what is the consistency contract? (Hint: it is not linearizable in the face of concurrent writes.)
  • What additional primitive does Cassandra provide for true linearizable writes?
  • What does "strong" mean in this doc sentence, precisely?

Claim D (Google Spanner)

"Spanner provides externally consistent transactions, a property that is stronger than serializability."

Translate:

  • What does external consistency mean relative to linearizability?
  • What is the role of TrueTime and commit-wait?
  • What is the read-latency floor for a cross-region strong read?

Claim E (Redis, default deployment)

"Redis replication is asynchronous. Replicas serve reads with eventual consistency."

Translate:

  • Describe an anomaly a client can observe reading from a replica after writing to the primary.
  • Does Redis give RYW across a follower read?
  • What if the primary fails and a replica is promoted?

Part 2: Analyze a Jepsen-Style History

Given this history (each row is a client operation; wall-clock time flows downward):

time  client    op                          result
1 C1 write(x, 1) ok
2 C2 read(x) -> 0
3 C1 write(x, 2) ok
4 C3 read(x) -> 1
5 C2 read(x) -> 0
6 C4 read(x) -> 2
7 C3 read(x) -> 2

Questions:

  1. Is this history linearizable? If not, point to the specific operation pair that violates real-time order.
  2. Is it sequentially consistent (every client sees some global order, but not necessarily respecting wall clock)? Argue yes or no.
  3. Is it causally consistent, where C1's writes are causally related (same client) but cross-client reads need not respect them?
  4. Is it monotonic-read for C2? For C3?
  5. Is it read-your-writes for C1? (Trick question: C1 only writes; provide the interpretation.)

Write your analysis as a paragraph, citing specific step numbers.

Part 3: Design for a Claim

Pick one of the following user-facing features and pick the weakest consistency model that is still correct. Justify.

  1. A "balance" shown immediately after a debit in a banking app.
  2. A "read receipt" in a chat app, where the sender sees whether the reader has opened the message.
  3. The "online" indicator next to a user's name.
  4. A unique username chosen at signup, across a globally distributed service.
  5. A "live comment count" under a viral social post.

Compare and Distinguish

  • Linearizable read vs strongly-consistent read (vendor): how often do these diverge?
  • Session guarantees vs causal consistency: when does one imply the other?
  • PACELC E-L vs E-C in practice: how much latency does consistency really cost in realistic deployments?

Common Mistake Check

  1. "DynamoDB strongly consistent is linearizable." Is it? Under all conditions?
  2. "I have read-your-writes, so my cross-user ordering is fine." Is it?
  3. "Cassandra with QUORUM gives serializability." Does it?
  4. "I need strong consistency" is a complete requirement. Is it?

Evidence Check

Complete only if:

  • You translated at least three of the five vendor claims into specific client contracts without paraphrasing the marketing.
  • You analyzed the Jepsen history with citations of step numbers.
  • You picked a consistency model for each of the five features with one-sentence justifications.
  • You can state, for any vendor doc you are given next week, the question that forces an honest answer about consistency.