quangh
quangh

Reputation: 408

Where does Cassandra reside in the CAP theorem?

Datastax course says that Cassandra is availability/partition tolerance. However, according to this document it can be tuned to be strong consistency (i.e. CP) by setting W + R > RF, where W is the write consistency level, R is the read consistency level, and RF is the replication factor.

Screenshot from datastax's course

Upvotes: 1

Views: 178

Answers (1)

Tuneable to strong consistency for single partition

  • It can be tuned to strong consistency for documents in single partition. So if you statements belong to different partitions (note same partition key and different table is still different partition), you cannot tune it for strong consistency. So Cassandra has its upper bound to it's strong consistency unlike in RDBMS where you can update multiple records in different tables or different rows in same table atomically.

Tuning for higher consistency makes you lose some of the AvailabilityandPartition Tolerance`

  • When you use hinted handoff, it is almost on the AP axis as it is always available to write even with network partitions. But as soon you start tuning for higher consistency, clients have to wait for writes or reads until it is written to enough replicas /read from enough replicas to satisfy the requested consistency. So you are losing bit of availability and partition tolerance

Summary

You can configure it for maximum availability and partition tolerance but you cannot configure for much stronger consistency. So Cassandra lies in AP axis in CAP

Upvotes: 2

Related Questions