Click or drag to resize
ConsistencyLevel Enumeration
Consistency refers to how up-to-date and synchronized a row of Cassandra data is on all of its replicas. When selecting, the consistency level specifies how many replicas must respond to a read request before returning data to the client application. When updating, inserting or deleting the consistency level specifies the number of replicas on which the write must succeed before returning an acknowledgment to the client application.

Namespace: Cassandra
Assembly: Cassandra (in Cassandra.dll) Version: 3.7.0
Syntax
C#
public enum ConsistencyLevel
Members
  Member nameValueDescription
Any0 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.
One1 Returns a response from the closest replica, as determined by the snitch.
Two2 Returns the most recent data from two of the closest replicas.
Three3 Returns the most recent data from three of the closest replicas.
Quorum4 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.

All5 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.

LocalQuorum6 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.

EachQuorum7 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.

Serial8 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.
LocalSerial9 Same as Serial, but confined to the data center.
LocalOne10 Similar to One but only within the DC the coordinator is in.
See Also