4 Replies Latest reply on Jul 6, 2011 11:49 AM by Sudheer Krishna

    Can data be inconsistent when using asynchronous replication ?

    Sudheer Krishna Novice



      Dude to performance reasons i would like to use asynchronous replcation over synchronous replications. By doing so is there any data inconsistency tissues that i will be facing ?


      I am using infinispan as a cache along with my mysql database . To maintain transactions across database and cache i am using atomikos transaction manager. Now with synchronous replication my transactions become expensive. So i was thinking about making the replication asynchronous. The kind of application we are working on data correctness is critical . We can afford to have a slight delay in updation, but correctness is importrant. 


      Also one of important things in our design is that, in most of these caches only one node updates the cache and all other nodes read from this cache. So i would prefere asynchronous replciation.


      We also have usescases where multiple nodes update the same cache. Is asynchronous replication safe here ?


      Example :


      Node 1 updates a cache - cache1.put(k1, v1);


      Node 2 :updates the same key in the cache - cache1.put(k2,v2).


      If both the above operations happen almost parallely in two sepearate  nodes , one overtaking the other by few milliseconds . Can we always asume that the lastest update wil be present in both nodes [since asynch replication is used how do we ensure lastest updates will override the earlier one]




      Do we need to use synchronous replication when  multiple nodes are writing in to teh same key and we want data correctness ?