ConsistencyLevel Enumeration |
Namespace: Dse
public enum ConsistencyLevel
Member name | Value | Description | |
---|---|---|---|
Any | 0 | Writing: A write must be written to at least one node. If all replica nodes for the given row key are down, the write can still succeed after a hinted handoff has been written. If all replica nodes are down at write time, an ANY write is not readable until the replica nodes for that row have recovered. | |
One | 1 | Returns a response from the closest replica, as determined by the snitch. | |
Two | 2 | Returns the most recent data from two of the closest replicas. | |
Three | 3 | Returns the most recent data from three of the closest replicas. | |
Quorum | 4 |
Reading: Returns the record with the most recent timestamp after a quorum of replicas has responded regardless of data center.
Writing: A write must be written to the commit log and memory table on a quorum of replica nodes. | |
All | 5 |
Reading: Returns the record with the most recent timestamp after all replicas have responded. The read operation will fail if a replica does not respond.
Writing: A write must be written to the commit log and memory table on all replica nodes in the cluster for that row. | |
LocalQuorum | 6 |
Reading: Returns the record with the most recent timestamp once a quorum of replicas in the current data center as the coordinator node has reported.
Writing: A write must be written to the commit log and memory table on a quorum of replica nodes in the same data center as the coordinator node. Avoids latency of inter-data center communication. | |
EachQuorum | 7 |
Reading: Returns the record once a quorum of replicas in each data center of the cluster has responded.
Writing: Strong consistency. A write must be written to the commit log and memtable on a quorum of replica nodes in all data centers. | |
Serial | 8 | Allows reading the current (and possibly uncommitted) state of data without proposing a new addition or update. If a SERIAL read finds an uncommitted transaction in progress, it will commit the transaction as part of the read. | |
LocalSerial | 9 | Same as Serial, but confined to the data center. | |
LocalOne | 10 | Similar to One but only within the DC the coordinator is in. |