question

biswa333_125242 avatar image
biswa333_125242 asked Erick Ramirez answered

What is the recommended replication factor for QUORUM consistency?

What should be the replication factor for QUORUM consistency ? Should it be 2 or 3 ?

replicationconsistency level
1 comment
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

dmngaya avatar image dmngaya commented ·

As Erick Ramire from datastax said on this post https://community.datastax.com/questions/4912/consistency-1.html , the best practice for read and write consistance is to use replication factor of 3 with QUORUM consistency.

0 Likes 0 ·
saravanan.chinnachamy_185977 avatar image
saravanan.chinnachamy_185977 answered

@biswa333_125242 A cassandra read\write operation's consistency level specifies how many of the replicas need to respond to the coordinator (the node that receives the client’s read/write request) in order to consider the operation a success.

Generally when using a replication factor of two or higher, operations at level quorum are used to achieve consistency. A quorum is calculated, and then rounded down to a whole number, as follows:

quorum = (sum_of_replication_factors / 2) + 1

Here sum_of_replication_factors is the sum of RF of all the data centers in a cluster. Users can configure the RF for each DC in a cluster, depending on their operational needs.

sum_of_replication_factors = datacenter1_RF + datacenter2_RF + . . . + datacentern_RF

For example in a Single DC cluster, using a replication factor of 3, 2 nodes are required to achieve quorum consistency ((3 / 2) + 1 = 2).

Please refer to our documentation for further details -> QUORUM

We strongly recommend a RF of 3 in a production cluster setting.

Share
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Erick Ramirez avatar image
Erick Ramirez answered

Our general recommendation is to configure 3 replicas in each data centre which means that you need a minimum of 3 nodes in each data centre.

In almost all cases, the correct consistency level to use is LOCAL_QUORUM. There are limited edge cases where other consistency levels are appropriate.

For more info, see Data replication in Cassandra. Cheers!

Share
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.