question

nirjharray avatar image
nirjharray asked Erick Ramirez edited

Why is "write ONE, read ALL" with RF=3 considered strong consistency?

The answer to the quiz on strong consistency expects "write one, read all" to be the correct answer. How can writing to one node be strong consistency?

workshopconsistency
cassandra-ques.jpg (52.3 KiB)
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

bettina.swynnerton avatar image
bettina.swynnerton answered

Hi,

Strong consistency means that you can read the data that you wrote into the database with assurance. As long as you have Read Consistency + Write Consistency > Replication Factor, you will achieve strong consistency.

In the case of "write one, read all", it is the consistency level READ ALL that delivers the strong consistency.

Even if only one replica has the latest, because only one replica was updated, all replicas are consulted for the reads, and one of them has the correct data (correct data = latest update). If the returned data differs, Cassandra will select the latest data based on the write timestamp before it gives it to the read request.

Opting for READ ALL will give you strong consistency, because you are reading everything, but it also requires all replicas to respond, which requires 100% availability, so it offers the least resiliency to failure.

But within the scope of the quiz, yes, this answer also applies.

Share
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.