Cassandra's Replication
Cassandra's Replication
Replication Factor: Replication in Cassandra can be defined as the number of copies of data present in the different nodes in the cluster. The main factor for availability in Cassandra is replication factor. Replication is set at KEYSPACE level.
Example: If we have a 3 node Cassandra cluster and if we give replication factor as 3, then the data will be available in all the 3 nodes. So, in this case we can get availability even if we loose 2 nodes. Hence replication factor is the one which gives us high availability in Cassandra.
The data will be stored in the cluster based on the hash value of the partition key. If the data's hash value falls under the particular token range then the data will be sent to that particular node. This node behaves as the primary token range. The storage of remaining replicas of data among the nodes can be described by using "replication strategies".
Replication Strategies:
There are two types of replication strategies. They are:
- SimpleStrategy
- NetworkTopologyStrategy
Comments
Post a Comment