cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alain RODRIGUEZ <arodr...@gmail.com>
Subject Re: Consistency Level (QUORUM vs LOCAL_QUORUM)
Date Thu, 31 Mar 2016 11:35:00 GMT
 Hi,

If you want the full immediate consistency of a traditional relational
> database, then go with CL=ALL, otherwise, take your pick from the many
> degrees of immediacy that Cassandra offers:


My understanding is using RF 3 and LOCAL_QUORUM for both reads and writes
will provide a strong consistency and a high availability. One node can go
down and also without lowering the consistency. Or RF = 5, Quorum = 3,
allowing 2 nodes node if you need more availability / redundancy (Never saw
that in use so far). I prefer this to ALL, that will produce the cluster to
be partially unavailable any time a node is down (crash or just a node
restart). I also never saw anyone using CL = ALL so far, for this exact
reason I believe.

Writing to 2 nodes out of 3 and reading from 2 nodes out of 3  --> using RF
= 3 / R&W CL = LOCAL_QUORUM, will give a strong and (almost) immediate
consistency. Remember there is no lock though, so immediate = as soon as
write succeed on enough nodes, 2 in our case).

If you need a strong consistency and are reading the same data in the 2
DCs, consider using EACH_QUORUM as Jack mentioned earlier.

Also, when using 2 datacenter, make sure to pin clients to one DC. Else you
might perform LOCAL_QUORUM operations on any of the 2 DCs, which would
remove the strong consistency.

More information about this last point on step 4 there:
https://docs.datastax.com/en/cassandra/2.1/cassandra/operations/ops_add_dc_to_cluster_t.html

About consistency
https://wiki.apache.org/cassandra/ArchitectureOverview#Consistency.

C*heers,
-----------------------
Alain Rodriguez - alain@thelastpickle.com
France

The Last Pickle - Apache Cassandra Consulting
http://www.thelastpickle.com

2016-03-28 5:44 GMT+02:00 Jack Krupansky <jack.krupansky@gmail.com>:

> The third choice is EACH_QUORUM which assures QUORUM in each data center
> (all data centers.)
>
> There is no "immediate consistency" per se in Cassandra. Cassandra offers
> "eventual consistency" and "tunable consistency" or the degree of immediate
> consistency, which is the CL that you specify - you specify the degree of
> immediate consistency that you require. If you want the full immediate
> consistency of a traditional relational database, then go with CL=ALL,
> otherwise, take your pick from the many degrees of immediacy that Cassandra
> offers:
>
> http://docs.datastax.com/en/cassandra/3.x/cassandra/dml/dmlConfigConsistency.html
> .
>
> In short, Cassandra does indeed guarantee the degree of immediate
> consistency that you specify (and presumably want.)
>
>
> -- Jack Krupansky
>
> On Sun, Mar 27, 2016 at 6:36 PM, Harikrishnan A <hari_ka@yahoo.com> wrote:
>
>> Hello,
>>
>> I have a question regarding consistency Level settings in a multi Data
>> Center Environment.  What is the preferred CL settings in this scenario for
>> an immediate consistency , QUORUM or LOCAL_QUORUM ?
>>
>> If the replication Factor is set to 3  each ( 2 Data Centers) , the
>> QUORUM ( writes/read) waits for 2 consistent response from nodes across the
>> cluster ( out of total 6 replications) , where as LOCAL_QUORUM expects 2
>> consistent response from 3 replicas within that LOCAL data Center.  If my
>> above understanding is correct, does that mean QUORUM doesn't guarantee
>> Immediate consistency ( in this multi Data Center Scenario) where as
>> LOCAL_QUORUM does guarantee the immediate consistency.
>>
>>
>> Thanks & Regards,
>> Hari
>>
>>
>>
>

Mime
View raw message