Question : 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. 1. Two replicas in each data center e.g. 2 copy in each DC Geneva, Nevada and Hyderabad 2. Three replicas in each data center e.g. 2 copy in each DC Geneva, Nevada and Hyderabad 3. One replica in each data center e.g. 1 copy in each DC Geneva, Nevada and Hyderabad 4. 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.
Question : Replication strategy is set during
1. Keyspace creation
2. Cluster creation
3. Table Creation
4. ColumnFamily Creation
Correct Answer : 1 Explanation: Replication strategy is defined per keyspace, and is set during keyspace creation. The Cassandra keyspace is a namespace that defines how data is replicated on nodes. Typically, a cluster has one keyspace per application. Replication is controlled on a per-keyspace basis, so data that has different replication requirements typically resides in different keyspaces. Keyspaces are not designed to be used as a significant map layer within the data model. Keyspaces are designed to control data replication for a set of tables.
Question : Which of the following components of Cassandra help you to determine which data centers and racks nodes belong to.
1. Network topology
2. Replication Strategy
3. Snitch
4. Partitioner
Correct Answer : 3 Explanation: A snitch defines groups of machines into data centers and racks (the topology) that the replication strategy uses to place replicas. A snitch determines which data centers and racks nodes belong to. They inform Cassandra about the network topology so that requests are routed efficiently and allows Cassandra to distribute replicas by grouping machines into data centers and racks. Specifically, the replication strategy places the replicas based on the information provided by the new snitch. All nodes must return to the same rack and data center. Cassandra does its best not to have more than one replica on the same rack (which is not necessarily a physical location).
1. It cannot be done, you have to create new Cluster altogether
2. you can configure another datacenter configured with vnodes already enabled and let Cassandra automatic mechanisms distribute the existing data into the new nodes.
3. you can configure another Cassandra cluster configured with vnodes already enabled and let Cassandra automatic mechanisms distribute the existing data into the new Cluster.