Question-51: What is single token architecture?
Answer: Single token architecture means, if in your Cassandra cluster there are four physical nodes then range of the token should be divided in four parts. Suppose you have 100 tokens for your cluster then each node is responsible for handling data for 25 tokens. In this case node one would be handling token range between 1 to 25, on second node range would be 26 to 50, similarly third node have to handle 51 to 75 and remaining 25 tokens would go on the fourth node.
Question-52: Can you give me an example how does single token architecture and v-node architecture distributed tokens?
Answer: Let's understand with the example where we have four physical nodes in your cluster. Each node is divided in 5 virtual nodes. So, there will be in total 20 virtual nodes. And each virtual node has to take care of 5 tokens out of hundred tokens. And it is not necessary that each physical node would have continuous range for example first node, it can be anything out of hundred tokens, generally each virtual node would be assigned with 5 tokens randomly based on the algorithm you chose.
Question-53: What all are the benefits of having virtual nodes rather than a single token architecture?
Answer: In case of virtual nodes
- Tokens are automatically calculated and assigned to each node.
- Cluster is automatically rebalancing when adding or removing new nodes. While node added or removed, load is balanced across the cluster rather than putting entire load on a single node.
- It helps in rebuilding dead node faster, because it involves every other node in the cluster for rebuilding new node or dead node.
- The proportion of v-node assigned to each machine in a cluster, so that you can make smaller and larger computer while building the cluster. Hence, it is possible that one physical node has 5 v-nodes and another physical node has 10 v-nodes in the same cluster.
Question-54: In which case you have to manually generate the token and assign to each node?
Answer: With single token architecture you have to generate the token for each physical node and assign by you using the configuration file. But in case of virtual node it is not required and consistent hashing is used to distribute the data.
Question-55: Do you see any disadvantage of using the V (virtual) node, in a particular situation?
Answer: Virtual nodes provides various operational benefits but also, we should keep in mind that if we increase the number of virtual nodes then it can impact the cluster wide performance. For example, if you are running the repair cycle and there are a greater number of virtual nodes then it would affect overall repair operation and increase the repair time.