NoSQL · Data models beyond tables

How do consistency levels work in distributed databases?

Hardconsistency levelsquorumscassandraUpdated Oct 2026
Quiz this track

Short answer

A consistency level says how many replicas must respond to a read or write. Quorums such as R + W > N give strong-ish reads, while ONE favours latency and ALL favours durability at the cost of availability.

Consistency levels are per operation, not per database. A write at QUORUM and a read at ONE can return stale data because the read may hit a replica that has not received the write. The guarantee comes from the combination of read and write levels and the replication factor.

sql
CONSISTENCY LOCAL_QUORUM;
INSERT INTO orders (id, status) VALUES (1042, 'paid');

CONSISTENCY QUORUM;
SELECT status FROM orders WHERE id = 1042;
Cassandra applies consistency at the session or statement level. LOCAL_QUORUM waits for a quorum inside the local datacenter only.

The levels you will meet

  • ONE: fastest, a single replica responds, stale reads are possible
  • QUORUM: majority of all replicas, tolerates some failures
  • LOCAL_QUORUM: majority within the client's datacenter, avoids cross-region latency
  • ALL: every replica must respond, highest consistency and lowest availability
  • SERIAL: used with lightweight transactions to provide linearizable compare-and-set

With replication factor 3, QUORUM is 2. If writes use QUORUM and reads use QUORUM, the sets overlap, so a read should see the latest acknowledged write unless a repair or failure path violates the assumption. Multi-datacenter deployments often use LOCAL_QUORUM to avoid paying cross-region latency on every request.

Quorum overlap is not a full linearizability guarantee in every system. Concurrent writes, sloppy quorums, hinted handoff and read repair all affect what a client observes. Read the specific engine documentation rather than applying the formula blindly.

Follow-ups you should expect

Interviewers use these to check whether the first answer was understanding or memorisation.

  1. 1What happens if a read uses ONE after a QUORUM write?
  2. 2Why is LOCAL_QUORUM common in multi-region deployments?
  3. 3When would you use ALL?
  4. 4Does R + W > N guarantee linearizability?

Say it in the interview

Consistency levels control how many replicas must respond for a read or write. With replication factor three, QUORUM is two, so a QUORUM write and a QUORUM read overlap and the read should see the latest acknowledged write. ONE favours latency but can return stale data, and ALL favours durability but fails if any replica is down. In multi-region systems I often use LOCAL_QUORUM to avoid cross-region latency. I am careful not to treat the quorum formula as a full linearizability proof.

Use this as a model, not a script. Saying it in your own words is what makes it survive follow-up pressure.

Related questions

Reading is step one

Now say it out loud.

Understanding an answer and delivering it under pressure are different skills. Rehearse this topic in a live NoSQL mock interview and get scored feedback on depth, clarity and confidence.