Database Reference
In-Depth Information
W + R <= N = eventual consistency
Consiisttency L
y Levell
This configurable setting allows you to decide how many replicas in the cluster must acknow-
ledge a write operation or respond to a read operation in order to be considered successful.
The consistency level is set according to your stated Replication Factor , not the raw number
of nodes in the cluster.
There are multiple levels of consistency that you can tune for performance. The best-per-
forming level has the lowest consistency level. They mean different things for writing and
reading. This is covered in Chapter 7 .
For write operations:
▪ ZERO: Write operations will be handled in the background, asynchronously. This is the
fastest way to write data, and the one that offers the least confidence that your operations
will succeed.
▪ ANY: This level was introduced in Cassandra 0.6 and means that you can be assured that
your write operation was successful on at least one node, even if the acknowledgment is
only for a hint (see Hinted Handof ). This is a relatively weak level of consistency.
▪ ONE: Ensures that the write operation was written to at least one node, including its
commit log and memtable. If a single node responds, the operation is considered suc-
cessful.
▪ QUORUM: A quorum is a number of nodes that represents consensus on an operation.
It is determined by <ReplicationFactor> / 2 + 1. So if you have a replication factor
of 10, then 6 replicas would have to acknowledge the operation to gain a quorum.
▪ DCQUORUM: A version of quorum that prefers replicas in the samedata center in order
to balance the high consistency level of quorum with the lower latency of preferring to
perform operations on replicas in the same data center.
▪ ALL: Every node as specified in your <ReplicationFactor> configuration entry must
successfully acknowledge the write operation. If any nodes do not acknowledge the write
operation, the write fails. This has the highest level of consistency and the lowest level of
performance.
For read operations:
▪ ONE: This returns the value on the first node that responds. Performs a read repair in the
background.
Search WWH ::




Custom Search