Question 18: You are designing Cassandra cluster, and you have been asked to span cluster in Geneva, Nevada and Hyderabad. You can configure consistency level of LOCAL_QUORUM or ONE.
The two primary considerations are
(1) being able to satisfy reads locally, without incurring cross data-center latency, and
(2) failure scenarios :
Which is the best strategy to configure replications.
- Two replicas in each data center e.g. 2 copy in each DC Geneva, Nevada and Hyderabad
- Three replicas in each data center e.g. 2 copy in each DC Geneva, Nevada and Hyderabad
- One replica in each data center e.g. 1 copy in each DC Geneva, Nevada and Hyderabad
- You can have three replicas in one data center e.g. Geneva and single replica in either Nevada and
Hyderabad
Correct Answer: 2
Explanation: Use NetworkTopologyStrategy when you have (or plan to have) your cluster deployed across multiple data centers. This strategy specify how many replicas you want in each data center.
NetworkTopologyStrategy places replicas in the same data center by walking the ring clockwise until reaching the first node in another rack. NetworkTopologyStrategy attempts to place replicas on distinct racks because nodes in the same rack (or similar physical grouping) often fail at the same time due to power, cooling, or network issues.
When deciding how many replicas to configure in each data center, the two primary considerations are (1) being able to satisfy reads locally, without incurring cross data-center latency, and (2) failure scenarios. The two most common ways to configure multiple data center clusters are: Two replicas in each data center: This configuration tolerates the failure of a single node per replication group and still allows local reads at a consistency level of ONE.
Three replicas in each data center: This configuration tolerates either the failure of one node per replication group at a strong consistency level of LOCAL_QUORUM or multiple node failures per data center using consistency level ONE.
Asymmetrical replication groupings are also possible. For example, you can have three replicas in one data center to serve real-time application requests and use a single replica elsewhere for running analytics.