Reputation: 182
I'm new to Cassandra. Let's assume I have 3 nodes and Replication Factor(RF) of the keyspace is 3.
Upvotes: 4
Views: 2613
Reputation: 1750
In your case, since there are 3 nodes and the replication factor is also 3, therefore, each node will have all the data. Therefore, even if only 1/3 node is operational, you'll still be able to fetch the complete data. However, the consistency of the data(i.e. whether you get the latest data or not) will, in this case, depend on the write consistency used(I'm assuming that since only 1/3 node is operational, therefore the read consistency is 1). In order, to get consistent data, the write consistency should be 3(Using the condition, R+W>N for strong consistency). Only then will you get consistent data while reading even when only 1/3 node is operational.
Upvotes: 0
Reputation: 331
It depends on what consistency level you've used for write and read requests.
For strong consistency: R + W > N
For eventual consistency: R + W =< N, where
- R is the consistency level of read operations
- W is the consistency level of write operations
- N is the number of replicas
In our care R + W <= 3
Now lets say, we have used QUORUM for read operations and ONE for write.
quorum = (sum_of_replication_factors / 2) + 1 = (3/2) + 1 = 2
read = 1
R + W <=3 is satisfied in our case.
You can configure consistency level according to needs but keep latency in mind.
You can read about that more consistency-handing and consistency-configuration
Coming back to you question, if only one node was being used then you wouldn't have an eventual consistency. You can use ONE for both read and write but it will defeat the purpose. Assuming nodes will be up again, I'd rather user LOCAL_QUORUM for write and TWO for read.
Upvotes: 3