Question 20: You have multi-datacenter cluster and a keyspace with, replication factor as 3. Which of the following will help you to determine best replica for reading.

  1. Snitches
  2. Replication strategy
  3. Replication factor
  4. Partitioner
  5. All replicas are equal and can be read from any node. And no need to find best replica to read.

Correct Answer: 1

Explanation: All snitches use a dynamic snitch layer, which monitors performance and chooses the best replica for reading.

It is enabled by default and recommended for use in most deployments. Configure dynamic snitch thresholds for each node in the cassandra.yaml configuration file.

The default SimpleSnitch does not recognize data center or rack information. Use it for single-data center deployments or single-zone in public clouds.

The GossipingPropertyFileSnitch is recommended for production. It defines a node's data center and rack and uses gossip for propagating this information to other nodes.