Reputation: 2422
I searched for the answer to this question in Stackoverflow and google in general but I always get 'only' that eventual consistency promise that eventually any write will get to all nodes in the cluster/quorum.
If it doesn't guarantee that, then why is it such a popular consistency scheme?
if node X does op1,op2,op3, and all of these updates propagate to node Y but in the order op3,op2,op1 it's not really helpful, isn't it?
In history prefix I mean that if node X current op history is op1,op2,op3 then if node Y has op1 or op1,op2 op history then it has the same prefix history of node X
Upvotes: 0
Views: 55
Reputation: 3571
No, it need not.
For example consider:
op1 at time t1 does 'set key-1=5'
op2 at time t2 does 'set key-1=6'
op3 at time t3 does 'set key-1=7'
Most asynchronous replication strategies will use some form of changelog to sync from the primary to the secondary replica. Now If I were to implement an 'eventual consistency' replication scheme in my DB or distributed storage, I would simply do a log compaction on the above steps and replicate just the last op (key-1=7) to the secondary. On the other hand, for a 'consistent prefix' scheme, I would need to replicate all 3 ops in the same order.
The choice of replication scheme depends on what kind of consistency your application wants when it reads from the secondary replica.
Upvotes: 0