Specifies how many replicas must respond to a read request before returning data to the client application.
Valid Values
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10
Behavior
If set to 1 (one), data is returned from the closest replica. This setting provides the highest availability, but increases the likelihood of stale data being read.
If set to 2 (two), data is returned from two of the closest replicas.
If set to 3 (three), data is returned from three of the closest replicas.
If set to 4 (quorum), data is returned after a quorum of replicas has responded from any data center.
If set to 5 (all), data is returned to the application after all replicas have responded. This setting provides the highest consistency and lowest availability.
If set to 6 (local_quorum), data is returned after a quorum of replicas in the same data center as the coordinator node has responded. This setting avoids latency of inter-data center communication.
(Cassandra 2.x only) If set to 7 (each_quorum), data is returned after a quorum of replicas in each data center of the cluster has responded.
Not supported for reads
If set to 8 (serial), the data is read without proposing a new addition or update. Uncommitted transactions are committed as part of the read.
If set to 9 (local_serial), the data within a data center is read without proposing a new addition or update. Uncommitted transactions within the data center are committed as part of the read.
If set to 10 (local_one), data is returned from the closest replica in the local data center.
Notes
If the server does not support the Read Consistency value specified, the connection attempt fails and the driver returns a consistency level error.
Refer to Apache Cassandra documentation for more information about configuring consistency levels, including usage scenarios.