Open In App

Consistency levels in Cassandra

In this article, we are going to discuss consistency levels in Cassandra which is very helpful for high availability and high mechanism in Cassandra. let’s discuss one by one.

First here, we are going to define the scenario of keyspace in which we will show how we have a different data center and each data center contains 3 replicas. let’s have a look.



CREATE KEYSPACE cluster_consistency
with replication =  {'class' : 'NetworkTopologyStrategy', 
                     'DC1': 3, 'DC2': 3, 'DC3': 3}
AND DURABLE_WRITES = false; 

In the above CQL query, we have three different data centers such as DC1, DC2, and DC3. Each data centers have 3 replicas which simply means the replication factor is three (RF =3).

Let’ s consider a scenario such that there is three number of replication factors in each 3 data centers.



Article Tags :