How to make Cassandra nodes have the same data?

107 Views Asked by At

I have two computers each one being a Cassandra node and they communicate well with each other. From what I understand Cassandra will replicate the data to each other but will always query certain portions from one of them. I would like though to have the data being copied to each other so they have the same data but they only use data from the local node. Is that possible?

The background reason is that the application in each node keeps generating and downloading a lot of data and at the same time both are doing some CPU super intensive tasks. What happens is that one node saves the data and suddenly can't find it anymore because it has been saved in the other node which is busy enough to reply with that data.

1

There are 1 best solutions below

0
On

Technically, you just need to change replication factor to a number of nodes, and set your application to always read from a local node using whitelist load balancing mode. But it may not help you because if your nodes are very busy, replication of data from another node may also not happen, so the query will fail as well. Or replication will add an additional overhead making the situation much worse.

You need to rethink your approach - typically, you need to separate application nodes from database nodes, so application processes doesn't affect database processes.