Cassandra Interview Questions Interview Questions

[Interview Question] – What is Quorum formula in Cassandra?

A quorum is calculated, and then rounded down to a whole number, as follows:
……………………………………..
quorum = (sum_of_replication_factors / 2) + 1
……………………………………..

The sum of all the replication_factor settings for each datacenter is the sum_of_replication_factors. ……………………………………..
sum_of_replication_factors = datacenter1_RF + datacenter2_RF + . . . + datacentern_RF
……………………………………..

Examples:

  • Using a replication factor of 3, a quorum is 2 nodes, The cluster can tolerate 1 replica down
  • Using a replication factor of 6, a quorum is 4. The cluster can tolerate 2 replicas down
  • In a two datacenter cluster where each datacenter has a replication factor of 3, a quorum is 4 nodes. The cluster can tolerate 2 replica nodes down
  • In a five datacenter cluster where two datacenters have a replication factor of 3 and three datacenters have a replication factor of 2, a quorum is 7 nodes

Write Consistency Levels:

LevelDescriptionUsage
QUORUMA write must be written to the commit log andmemtable on a quorum of replica nodes.Provides strong consistency if you can tolerate some level of failure

Read Consistency Levels

LevelDescriptionUsage
QUORUMReturns the record after a quorum of replicas has responded from any datacenter.Ensures strong consistency if you can tolerate some level of failure.

See more about Configuring data consistency

Review
4

Categories

Categories