Consistency Level (CL)

2 min reading

The number of nodes that must acknowledge a read or write operation before it is considered successful. For data to be successfully written or read back to the client,  a sufficient number of nodes need to agree on the data’s correct state. Note that while you can set consistency levels for all operations (on the client-side), ScyllaDB allows each operation (each read or write) to have its own consistency level, a feature known as tunable consistency.

  • CL of 1: Wait for a response from one replica node
  • CL LOCAL_QUORUM:  Wait for floor((#dc_replicas/2)+1), meaning that if a DC has 3 nodes replica in the cluster, the application will wait for a response from 2 replica nodes
  • CL EACH_QUORUM: For multi DC, each DC must have a LOCAL_QUORUM. This is unsupported for reads.
  • CL ALL: All replica nodes must respond. Provides the highest consistency but lowest availability.

A write can succeed before every replica has stored it, so for a short time some replicas may hold older data. This is called eventual consistency : all the replicas eventually reach the same state, while operations continue in the meantime. A higher Consistency Level, such as QUORUM for both reads and writes, makes sure a read sees the latest acknowledged write. More information about high availability, replication, and consistency can be found in this lesson .


Something wrong with this lesson? Tell us