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
- Define linearizability in one sentence.
- State each of the four session guarantees.
- Define causal consistency.
- State PACELC in one line.
- 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=trueon 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=truereads after a write within the same session? across sessions? during an AZ failure? - PACELC label for each mode.
Claim B (MongoDB)
"With
readConcern: majorityandwriteConcern: 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
QUORUMon 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:
- Is this history linearizable? If not, point to the specific operation pair that violates real-time order.
- Is it sequentially consistent (every client sees some global order, but not necessarily respecting wall clock)? Argue yes or no.
- Is it causally consistent, where C1's writes are causally related (same client) but cross-client reads need not respect them?
- Is it monotonic-read for C2? For C3?
- 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.
- A "balance" shown immediately after a debit in a banking app.
- A "read receipt" in a chat app, where the sender sees whether the reader has opened the message.
- The "online" indicator next to a user's name.
- A unique username chosen at signup, across a globally distributed service.
- 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
- "DynamoDB strongly consistent is linearizable." Is it? Under all conditions?
- "I have read-your-writes, so my cross-user ordering is fine." Is it?
- "Cassandra with QUORUM gives serializability." Does it?
- "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.