Quorum

Learned in SE464.

Quorum

A quorum is a minimum percentage of a committee needed to act.

In a distributed DB, to ensure consistency, the DB waits for acknowledgement of consistent data from a certain number of replicas before considering the read/write complete. This prevents progress until the replicas have a certain degree of consistency.

It’s essentially a voting mechanism where you wait on the majority.

Example 1: write and read quorum of 2 (of 3 replicas)

  • Client performs a write, gets two ACKs, and proceeds.
  • Replicas now store two new values and one old value.
  • One of the written-to replicas fails. Can reads and writes proceed?
  • Yes. Two different values will be read, but the client can choose the most recent one. The third write is eventually received, and two consistent copies are available.

Example 2: write quorum of 3 (read quorum of 1)

  • A replica fails. Can reads and writes proceed?
  • Client performs a write and cannot get three ACKs. Write is impossible (but reads proceed).
  • Part of the system is temporarily stalled. The write can be retried after a replacement joins the DHT and copies the data.

Tradeoffs

Different quorum levels (all, majority, one) trade delay of reads/writes against whether reads or writes become unavailable during recovery.

  • Cassandra lets the programmer choose the quorum level for each read/write.
  • Other NoSQL databases are designed to use just one read/write strategy.