From what I gather from this answer, if write quorum is not achieved, cassandra does not rollback the writes from the database that persisted the write.
What is the point of having a write quorum at all? How is it different from a best-effort write or sending writes to all the nodes and only waiting for one success?
The point of using QUORUM
for writes is to provide a guarantee, when those writes succeed, that subsequent reads with QUORUM
will be consistent.
It's true that writes don't roll back, and Cassandra has mechanisms to eventually propagate writes to all replicas - hints, repairs, read repairs. However, none of these mechanisms provides a guarantee that a read query result using QUORUM
will return the latest version of the data.
On the other hand, when a write with QUORUM
succeeds, then a read with QUORUM
for the same data will always be consistent, since at least 1 replica involved in the read request, while also involved the latest QUORUM
write, returns up-to-date data. Even in the scenario where only 1 replica involved in the QUORUM
read is consistent, Cassandra will resolve inconsistencies with a blocking read repair before returning results.
If you use any write consistency lower than QUORUM
, even if you use QUORUM
for reads, there's no guarantee that the read request will read from the replicas that succeeded in the write statement.
If alternatively you write with consistency level ALL
, then you lose high availability in Cassandra - all it takes to get downtime is one unavailable node.
The formula to guarantee data consistency on reads is:
read_consistency_level + write_consistency_level > replication_factor
And usually LOCAL_QUORUM
for both read and write consistency levels is the sweet spot for availability and data consistency.
I hope this helps.