bhuvaneshdct avatar image
bhuvaneshdct asked bhuvaneshdct commented

What is the impact of altering replication settings on a huge keyspace?

I have a Cassandra 3.11.3 setup (3 nodes). There are a few keyspaces in the cluster and everything created with SimpleStretegy I want to change it to `NetworkTopology` The largest size of a keyspace is 2TB.

If I run the alter keyspace command, will it take more time or block any write? and recommened to run this on Production hours?

10 |1000

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

Erick Ramirez avatar image
Erick Ramirez answered

The impact of changing the replication settings depends on your environment.

Replica count

If there are already 3 replicas then switching from SimpleStrategy to NetworkTopologyStrategy will have no impact. Both reads and writes will operate as normal.

If there is only 1 replica then increasing the replication factor to 3 replicas in the DC might affect reads.

Read requests

If the replication factor is the same, reads will not get affected.

But if you increase the number of replicas and the application reads at a consistency level higher than ONE or LOCAL_ONE then there won't be enough replicas to satisfy the requests and reads will get blocked until read repairs have completed on replicas with the missing data.

You will need to manually repair the keyspace to redistribute the data to other nodes in the cluster. This will be IO-intensive so I recommend you carry out this work during low traffic periods.

Write requests

Whether you change the replica count or not will not affect writes. It just means that the mutations will get sent to more nodes if you increase the replica count.

For this reason, I always recommend you use NetworkTopologyStrategy for all application keyspaces regardless of whether your cluster is running multi-DC or not to avoid having to deal with this situation. Cheers!

10 |1000

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

David Jones-Gilardi avatar image
David Jones-Gilardi answered bhuvaneshdct commented

Just to reinforce to what @Erick Ramirez said, yea, just start by using NetworkTopologyStrategy out of the gate. While it's true the default setting is SimpleStrategy, the moment you go from using a single node in a quick test cluster to something looking like a real cluster you should switch.

1 comment Share
10 |1000

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

bhuvaneshdct avatar image bhuvaneshdct commented ·

Thanks, Yeah, right now its just a 3 node cluster, I want to migrate it to a new cluster(using data center replication). That's why I'm making this change. But I think these changes are fine right? no need to modify anything on the YAML config files.

0 Likes 0 ·