Question-: In your Cassandra cluster you have nodes, and you want to keep replication factor as . And you will be adding one additional node to the cluster after a month. In this case keeping replication factor is fine? A. Yes B. No
Answer: A Exp: You can keep the replication factor more than number of nodes, if you plan to add more nodes to the cluster. Else you should not keep it more than number of nodes.
Admin only
Question-: Which of the following best replication strategy for production Cassandra Cluster setup. Assuming you have Cassandra cluster with nodes, which are across datacenters in Europe, North America and Asia region?
A. SimpleNetworkStrategy B. SimpleStrategy C. DatacenterAwareTopology D. DatacenterAwareNetworkTopology E. NetworkTopologyStrategy
Answer: E
Explanation: SimpleStrategy : In this topology first replica will be placed based on partitioner decision and additional replica are placed on the next nodes clockwise in the ring without considering topology for example rack and datacenter location. NetworkTopologyStrategy: This one is recommended for the production deployments, using this you can expand your cluster to multiple datacenters. Using this you can define how many replicas are needed in a particular datacenter.
This also places the replica across the different racks in a datacenter. Because if placed in the same rack, which can fail and at the same time all the replicas will be lost, if kept in the same rack.
Replication strategy is defined per keyspace, and is set during keyspace creation.
Admin Only
Question-: Please match the below
A. Virtual Nodes B. Single Token Architecture C. Murmur3Partitioner D. RandomPartitioner E. Snitch
1. The possible range of hash value is from 0 to 2^127 -1 2. Range of partition key token between -2^63 tp +2^63-1 3. It uses either allocation algorithm or random selection algorithm to specify the number of tokens. 4. You must have to enter the values in the initial_token parameter in the Cassandra.yaml file. 5. It can be used to find which datacenters and racks nodes below to.
Answer: A-3, B-4, C-2, D-1, E-5 Exp: Token assignment depend the type of architecture you chose as below. - Virtual nodes: This uses either the allocation algorithm or the random selection algorithm to specify the number of tokens distributed to nodes within the datacenter. All the nodes in a datacenter must use the same algorithm. - Single token architecture: To ensure data is evenly divided across the nodes in the cluster, you must enter values in the initial_token parameter in the Cassandra.yaml file for each node. Data partitioned with one partitioner cannot be converted to the other partitioner.
About partitioner: - Murmur3Partitioner: This is a default partitioner and uses the hashing function to creates the 64-bit hash value of the partition key with a possible range from -2^63 to +2^63-1. It is the default one and must be used with the new cluster because it is more performant then any other existing one. - Random partitioner: This is still available because of backward compatibility. It uniformly distributes data evenly across the nodes using an MD5 hash value of the row key. The possible range of hash values are 0 to 2^127-1. And it less performant than Murmur3Partitioner. Snitch: Using snitch it can be found that in which datacenters or racks the nodes belong to. It is snitch responsibility to let database know the network topology so requests are routed efficiently. Hence, replication strategy places the replica of the data based on the information provided by the new snitch. All nodes in the cluster must have the same snitch. And you should avoid same replica on the same rack.