SERIAL consistency is a ScyllaDB consistency level that guarantees a read observes the latest value. ScyllaDB uses Paxos to determine that value, giving reads linearizability: each read appears ordered according to when it occurred. section 8.2.2
Choose SERIAL consistency with these trade-offs in mind:
- It provides stronger read guarantees than weaker consistency levels, which can return stale data. section 8.2.2
- It is expensive because Paxos requires additional coordination, much like lightweight transactions. section 8.2.2
- It favors consistency over availability: queries can fail when required replicas are unavailable. section 8.2.2
- Using QUORUM for both writes and reads can provide the latest value without an LWT-based read. section 8.2.2
Table 8.1 Scylla supports many consistency-level choices for your queries to balance consistency and availability.
|
Consistency level
|
Required nodes to respond
|
|---|---|
|
ANY
|
Any node in the cluster can respond, even if it’s not a replica
|
|
ONE
|
A single replica
|
|
LOCAL_ONE
|
A single replica in the same datacenter
|
|
TWO
|
Two replicas
|
|
THREE
|
Three replicas
|
|
QUORUM
|
A majority of replicas
|
|
LOCAL_QUORUM
|
A majority of replicas in the same datacenter
|
|
EACH_QUORUM
|
A majority of replicas in every datacenter
|
|
SERIAL (used to get the latest data via Paxos)
|
A majority of replicas
|
|
LOCAL_SERIAL
|
A majority of replicas in the same datacenter
|
|
ALL
|
Every replica in the cluster
|
Compare SERIAL with consistency levels that require one replica, a quorum, or every replica to respond. section 8.2.2
