Skip to content

Conflict Resolution

Alex Moore edited this page Jun 10, 2015 · 3 revisions

Note: This document is for the 1.x Java Client series.

Eventual Consistency and you

Riak, except in the most basic use cases, is an eventually consistent system. If you're not familiar with the concept a read of our wiki entry on the subject is in order.

To deal with conflict resolution, the Java client provides the Resolver interface which allows you to provide code to resolve sibling records returned by Riak. If you do not supply a Resolver the DefaultResolver is used, which simply throws an exception if siblings are present.

One thing worth noting: In the current Java client it is impossible to do a store operation without a fetch being triggered. Internally a fetch is done, conflicts are resolved via the supplied Resolver object, and the resulting object is then stored. Unfortunately this isn't optimal for the usual case where you're doing a read/modify/write and we will be rectifying this in a future release.

(coming soon)