Database Reference
In-Depth Information
Comparing consistency levels
Having explored the three most useful consistency levels Cassandra provides, let's compare
their important characteristics:
Replicas re-
quired
Level
Consistency behavior
Failure tolerance
Performance
Tolerates failure of all but one
replica
ONE
Eventual
1
Fastest node
Immediate
All
None
Slowest node
ALL
QUORUM Immediate, if used for both writes
and reads
Tolerates failure of a minority of
replicas
Median performing
node
Strict majority
Cassandra supports eight other consistency levels; their uses are more esoteric and many
deal specifically with deployments where a cluster is spread across multiple data centers.
For a full reference, see http://www.datastax.com/documentation/cassandra/2.1/cassandra/
dml/dml_config_consistency_c.html .
Choosing the right consistency level
We've explored how the process of updating alice 's email address would work at the
consistency levels ONE , ALL , and QUORUM . But what consistency levels should the
MyStatus application actually use?
We recognized earlier that, in the case where alice updates her own user profile and then
views the results, eventual consistency is undesirable: if she sees an outdated copy of her
profile, it may appear that her email address update did not work at all. So, we will want to
ensure that, from alice 's standpoint, changes to her profile are immediately consistent.
We've seen that, of the two levels that ensure immediate consistency, QUORUM has consid-
erably more appeal from the perspective of fault-tolerance and performance. We also know
that, in order to get immediate consistency from QUORUM , we'll need to both write and read
at the QUORUM level.
Search WWH ::




Custom Search