Reputation: 2310
I am new to Cassandra. I wanted to know how vnodes are replicated in Cassandra. I went through Cassandra codebase looking for answers but only could found how tokens are allocated. Any help in telling the class will be helpful. Thanks
Upvotes: 1
Views: 270
Reputation: 1538
Vnodes are just multiple token ranges instead of one. Data replicates on primary partition first and then replicates other copies on different nodes or different racks based on RF and replication strategy. if we are using vnodes then we don't require to calculate tokens manually while adding or removing nodes. other benefits also for that please refer apache or datastax documentation of vnodes.
Upvotes: -1
Reputation: 2982
The first copy of a partition is placed in the node that owns that partition's token. The additional n copies are placed sequentially on the next n nodes in the ring that are in the same dc.
Vnodes do not change this process, they just split up each node's token ranges by allowing each node to have more than one token.
I would suggest some more reading on this subject: 1, 2, 3, 4.
Upvotes: 2