Course contentsShow
← System Design
Lesson 366 of 1,91910. NoSQL: Key-Value StoresFree lesson

Sloppy Quorums and Hinted Handoff

How distributed KV stores maintain availability during node failures using temporary replica placement.

Sloppy Quorums and Hinted Handoff

What You'll Learn

You'll learn how distributed key-value stores stay available even when some nodes fail by temporarily storing data on alternate nodes.

The Problem with Strict Quorums

In the previous lesson, you learned about quorum reads and writes (R + W > N). But what happens when multiple nodes in your preference list are down, and you can't reach enough replicas to satisfy the quorum?

A strict quorum would reject the write, sacrificing availability for consistency.

Enter Sloppy Quorums

A sloppy quorum relaxes this requirement. Instead of only writing to the designated replica nodes, the system accepts writes to any N healthy nodes in the cluster, even if they're not the "correct" homes for that key.

Think of it like package delivery: if your neighbor isn't home, the delivery driver leaves the package with another neighbor temporarily, rather than refusing delivery altogether.

Hinted Handoff: The Return Journey

When a node accepts data it shouldn't permanently own, it stores a hint indicating which node should eventually receive it. Once the originally intended node comes back online, the temporary holder transfers the data back—this is hinted handoff.

The temporary node essentially says: "I'm holding this for Node X. When X returns, I'll hand it off."

Trade-offs

  • Benefit: Your system remains available for writes even during network partitions or node failures
  • Cost: Temporarily increased inconsistency—reads might miss recent writes until hinted handoff completes
  • Guarantee: You still write to N nodes, but they might not be the "right" N

This technique prioritizes availability over immediate consistency, making it ideal for systems where writes must never be rejected.

Key Takeaway: Sloppy quorums and hinted handoff sacrifice strict consistency guarantees to maintain write availability during failures, temporarily storing data on substitute nodes until the intended replicas recover.