Hello Anurag,

In Cassandra, Strong consistency is guaranteed when "R + W > N" where R is
Read consistency, W is Write consistency and N is the Replication Factor.

So in your case, R(2) + W(1) = 3 which is NOT greater than your replication
factor(3) so you will not be able to guarantee strong consistency. This is
because you will write to 1 replica but your immediate read can go to the
other 2(quorum) replicas and they might not be updated yet.

On Sun, Jul 16, 2023 at 8:06 AM Anurag Bisht <bisht.anurag...@gmail.com>
wrote:

> thank you Jeff,
> it makes more sense now. How about I write with ONE consistency,
> replication factor = 3 and read consistency is QUORUM. I am guessing in
> that case, I will not have the empty read even if it is happened
> immediately after the write request, let me know your thoughts ?
>
> Cheers,
> Anurag
>
> On Sat, Jul 15, 2023 at 7:28 PM Jeff Jirsa <jji...@gmail.com> wrote:
>
>> Consistency level controls when queries acknowledge/succeed
>>
>> Replication factor is where data lives / how many copies
>>
>> If you write at consistency ONE and replication factor 3, the query
>> finishes successfully when the write is durable on one of the 3 copies.
>>
>> It will get sent to all 3, but it’ll return when it’s durable on one.
>>
>> If you write at ONE and it goes to the first replica, and you read at ONE
>> and it reads from the last replica, it may return without the data:  you
>> may not see a given write right away.
>>
>> > On Jul 15, 2023, at 7:05 PM, Anurag Bisht <bisht.anurag...@gmail.com>
>> wrote:
>> >
>> > 
>> > Hello Users,
>> >
>> > I am new to Cassandra and trying to understand the architecture of it.
>> If I write to ONE node for a particular key and have a replication factor
>> of 3, would the written key will get replicated to the other two nodes ?
>> Let  me know if I am thinking incorrectly.
>> >
>> > Thanks,
>> > Anurag
>>
>

-- 

Thanks,

*Dipan Shah*

*Data Engineer*

[image: https://www.anant.us/Home.aspx]


3 Washington Circle NW, Suite 301

Washington, D.C. 20037


*Check out our **blog* <https://blog.anant.us/>*!*


This email and any attachments to it may be confidential and are intended
solely for the use of the individual to whom it is addressed. Any views or
opinions expressed are solely those of the author and do not necessarily
represent those of Anant Corporation. If you are not the intended recipient
of this email, you must neither take any action based upon its contents,
nor copy or show it to anyone. Please contact the sender if you believe you
have received this email in error.

Reply via email to