PLANNED MAINTENANCE

Hello, DataStax Community!

We want to make you aware of a few operational updates which will be carried out on the site. We are working hard to streamline the login process to integrate with other DataStax resources. As such, you will soon be prompted to update your password. Please note that your username will remain the same.

As we work to improve your user experience, please be aware that login to the DataStax Community will be unavailable for a few hours on:

  • Wednesday, July 15 16:00 PDT | 19:00 EDT | 20:00 BRT
  • Thursday, July 16 00:00 BST | 01:00 CEST | 04:30 IST | 07:00 CST | 09:00 AEST

For more info, check out the FAQ page. Thank you for being a valued member of our community.


question

aravinth_chakravarthyr_173918 avatar image
aravinth_chakravarthyr_173918 asked ·

How is data distributed and replicated in a cluster?

Based on partition range given to each node, A data which is inserted will move to respective node based on the partition key . Based on what the replicates of the data are moved to other nodes .For Example if i have 6 node cluster with test keyspace Replication factor 3 and i am inserting a record in test.test table which is stored in node 1 based on partition , where does the other two replicas are stored in and what is the factor that decides the replicas to store in the particular node . If it is based on replica placement strategy please let us know how it works in detail, or share a document which deals with this.

cassandrareplicationpartitioner
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

Erick Ramirez avatar image
Erick Ramirez answered ·

@aravinth_chakravarthyr_173918 The partitioner will always determine the placement of the partition in the ring. Once that happens, the replicas are always placed in the adjacent nodes in the ring.

For example, consider a cluster with nodes A to F where:

  • replication factor of 3,
  • B is to the right of A in the ring,
  • C to the right of B,
  • D to the right of C, and so on.

If for a given partition, the partition key's token value is determined to be on node C which means the first replica (copy) will be placed on this node. The second replica is placed on the next node D and the third replica placed next to it which is E.

It gets a bit more complicated if there were racks in the topology but in brief, C* will try to place a copy (replica) on another rack meaning that C* will keep going around the ring until the "next node" is in another rack.

For more info, see Data distribution and replication. Cheers!

Share
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.