This is a practical demo of what we discussed in Network Topology replication strategy in the previous post.
Setup status using nodetool :
Now lets see the Need for Multi-DataCenter :
1) Workload Separation :
We could distribute the work between two data centres based on the functional need.
Example :
We can have two clients for Cassandra in which one client will read the data from newyork data centre and another from chennai data center.
2) Data backup across data centres:
Since we are going to follow Network Topology replication strategy (Explained in the previous post), In case of whole data centre failure another data centre will hold the data.
3) Geographical location
Proposed replication strategy for Multi-Datacenter setup :
In case of Multi-DataCenter, we need to follow the ‘Network Topology strategy’ in Cassandra.
Network Topology strategy :
As per the current structure (newyork and chennai datacenter), If the client writes to the data center ‘newyork’, then it will be replicated to the chennai datacenter as per the configuration we provide.
(i.e) If the client write a data in newyork, It replicates to one node in the chennai datacenter.
(i.e) If the client write a data in chennai, It replicates to one node in the newyork datacenter.
DEMO :
3) I am trying to read the same data from the nodes in the datacenter ‘chennai’, Since we used the ‘network topology strategy’ with the replication factor as ‘1’ for every write the data is replicated to another data center (‘chennai’ in our case)
Based on this analysis, study and observation, we are clear that the data replication and live back up scenario is completely possible in Cassandra.
The only caveat in network topology strategy is : If the datacenters are very far (latency between DC’s) then we end up in high latency in write which is obvious.
No comments:
Post a Comment