Course contentsShow
← System Design
Lesson 559 of 1,91915. Consistency ModelsFree lesson

Strong Consistency with Quorums

Achieving linearizability by setting R + W > N and using read-repair or version vectors to resolve conflicts.

Strong Consistency with Quorums

What you'll learn: How to achieve linearizability using quorums by ensuring R + W > N and resolving conflicts through read-repair or version vectors.

The Core Idea

You've learned that setting R + W > N creates overlapping quorums—meaning read and write sets always share at least one node. But overlap alone doesn't guarantee linearizability (strong consistency). You need an additional mechanism to ensure you always read the most recent write.

The key is this: when your read quorum returns multiple versions of the same data, you must:

  1. Identify the latest version using timestamps or version vectors
  2. Return that latest value to the client
  3. Repair outdated replicas (read-repair) by writing the latest value back to nodes with stale data

How It Works

Think of it like a voting system where ballots have timestamps. When you collect votes (read from R nodes), some might be outdated. You:

  • Pick the ballot with the newest timestamp as the "true" answer
  • Update any voter who had old information

Version vectors help when timestamps aren't reliable or when tracking causality matters. They record which writes each replica has seen, letting you detect conflicts and choose the most recent consistent state.

Why R + W > N Isn't Enough Alone

Without read-repair or proper version ordering, you might read stale data even with overlapping quorums if you randomly pick a value from the overlap. The repair mechanism ensures linearizability—every read reflects the most recent completed write.

Key Takeaway:
Strong consistency with quorums requires R + W > N plus a conflict resolution mechanism (like read-repair with version vectors) that always returns and propagates the latest value.