Skip to content

Quorum

Quorum — Instant Recall


The Problem It Solves

Single primary dies → who takes over? Which replica has the latest data? How do you failover without data loss and without human intervention?

Quorum removes the single primary entirely. Replaces it with a mathematical guarantee.


The Core Idea

No special node. Any node accepts writes. Any node serves reads.

Consistency comes from the math:

W + R > N

If your write set and read set are guaranteed to overlap — at least one node in your read set has the latest write. Always.


The Numbers

  • N = total nodes
  • W = how many must ack a write before client gets success
  • R = how many nodes you read from, take the newest value

W = 3, R = 2, N = 4 → 3 + 2 > 4 → guaranteed overlap → CP

W = 1, R = 1, N = 4 → 1 + 1 < 4 → no guarantee → AP


The Control Surface

You don't manage this in app code. You express it at query level:

INSERT INTO payments USING CONSISTENCY QUORUM;   -- CP
SELECT * FROM feed USING CONSISTENCY ONE;         -- AP

Same mental model as your primary/replica routing — just declared at query level instead of connection string level.


What You Lose vs Your Postgres Setup

Your LSN pattern gives you per-user session consistency. Quorum cannot do that. Consistency level is per query type, not per user session.


When To Use It

Scenario Use
Single region, one primary Your Postgres + LSN setup. Simpler, more control.
Primary must failover automatically Quorum or Postgres + Patroni
Multi region, low latency writes Cassandra with LOCAL_QUORUM
High write throughput, leaderless Cassandra / ScyllaDB

The One Thing That Can Still Go Wrong

LOCAL_QUORUM per region → two regions accept writes independently → same key written in both → conflict.

Cassandra resolves via Last Write Wins — later timestamp wins, other write silently discarded. No error to client. Clock skew can cause you to lose a valid write.


The One Line

Quorum trades per-user consistency granularity and operational visibility for automatic failover, leaderless writes, and multi-region scalability. W + R > N is CP. Below that is AP. You pick per query.