What the best way to ensure that changes to the 2 caches are atomic.
So if something changes the state of the caches to this:
cache1.put("hello", 2)
cache2.put("hello", "B" }
i don't want this to happen when getting the values from the cache:
cache1.get("hello") == 2
cache2.get("hello") == "A"
I'm ok with getting the initial state after the cache has been changed (i don't need strong consistency) but having one new value and the other old is unacceptable to me.