1
votes

What is the relationship between a node and partition key in cassandra. According to partition key's hash value the data will be stored in a node, is that mean there is "one to one" relationship in between a node and partition key i.e one node contains only one value of hashed value of partition key or a node can contains multiple hashed value of partition keys. As I'm new to cassandra got confused in this basic point.

2

2 Answers

1
votes

Each Node in cassandra is responsible for range of hash value of partition key (Consistent hashing).

By default casssandra uses MurMur3 partitioner.

So on each node in cassandra there will be multiple partition keys availaible. For same partition key there will be only one record on one node, other copies will be available on other nodes based on replication factor.Consistent Hashing in cassandra

1
votes

partition keys determine the locality of the data. in a cassandra cluster with RF=1, there will be only a single copy of every item, and all the items with the same partition key will be stored in the same node. depending on your usecase, this can be good or bad.

back to your question: it is NOT true that "one node contains only one value of hashed value of partition key" but rather the other way around: all the items with the same partition key would be stored in one node (along with other partition keys, potentially).