Dojo
Dojo

Reputation: 5684

Is this possible in Cassandra?

I want data to be replicated across 4 machines.

3 of them are servers hosted in datacenter and there is one development machine which can be offline when development is not being done.

The 3 datacenter servers will be the Primary source for all data. the dev machine will not be the primary source for any data. But it will have all data of the other 3 machines.

When the dev machine goes online, it would sync with the other nodes and after that all queries from dev environment will run on Cassandra instance in the dev machine. Or atleast, I think, I'll get the quickest response from the local machine.

If possible, even when the dev machine is not connected to the internet, I want to be able to run queries (read only ones) against Cassandra instance on the dev machine.

Upvotes: 0

Views: 89

Answers (2)

Aftab
Aftab

Reputation: 938

What I am considering here is you have two data centers DC1 with 3 nodes and DC2 with 1 node local one. Consider the down time for the node in DC2 and set the time for hintedhandoff accordingly it will try to sync data if the down node comes online and it's not already marked as dead.

Upvotes: 1

Jeff Jirsa
Jeff Jirsa

Reputation: 4426

You have two basic options here:

1) Create a 2 datacenter cluster, as Aftab mentions, where one datacenter is the dev node. That will allow you to query it with LOCAL_ONE consistency while disconnected, and it will work as intended. I'd disable hints entirely, and assume that you'll need to repair/rebuild whenever you've been disconnected for an extended period of time. Note that writes done to this node will replicate to production, so you'd want to be sure that your development doesn't accidentally do any accidental deletes/overwrites, or you'll replicate those upon reconnection.

2) Keep the dev server disconnected, and load data from production to dev using sstableloader, cassandra's bulk loading tool. Replicate data only when necessary, and only in one direction.

Upvotes: 1

Related Questions