Say we have two nodes(simple replica no sharding) i.e. N1,N2 with replication factor as 2. I am using default Read and write consistency levels i.e. R
and W
are 1 which means it will read/write from/to single node
Scenario 1
1. Consider write request goes to node N1 to update record R1. Say name `scott` updated to `scott_update1`
2. Before it is replicated to N1, N1 crashed
3. Another write request goes to node N2 to update the same record R1. Now `scott` updated to `scott_update2`
4. Now when N1 comes back, will the name `scott_update1` be updated to `scott_update2` ?
- Consider write request goes to node
N1
to update recordR1
. Say namescott
updated toscott_update1
- Before it is replicated to
N2
,N1
crashed - Another write request goes to node
N2
to update the same recordR1
. Nowscott
updated toscott_update2
- Now when
N1
comes back, will the namescott_update1
be updated toscott_update2
?
Scenario 2
1. Consider write request goes to node N1 to update record R1. Say name `scott` updated to `scott_update1`
2. Before it is replicated to N1, N1 crashed
3 . Read request goes to node N2 to read the same record R1. It returns `scott`
3. Now when N1 comes back, will the name `scott_update1` be updated to `scott` or it will stay `scott_update1` ?
- Consider write request goes to node
N1
to update recordR1
. Say namescott
updated toscott_update1
- Before it is replicated to
N2
,N1
crashed - Read request goes to node
N2
to read the same recordR1
. It returnsscott
- Now when
N1
comes back, will the namescott_update1
be updated toscott
or it will stayscott_update1
?