For automatic conflict resolution, often times, the easiest thing to do is
impose a Last Write Wins policy.

However, in certain circumstances, First Write Wins makes more sense. For
example, suppose you are handling user creation. Creating a single user
will populate values for two keys:

User Id => User data
Username => User Id

A unique User Id is generated to accommodate future username changes. In
the event that another user attempts to create an account simultaneously
with the same username, a conflict will exist. The easiest thing for me to
do here, is after the account is created, check the username to see if it
points to the correct User Id. If so, return a success message. Otherwise,
rollback changes to the first key.

I'm OK with last write wins for now, but is there a way of imposing a
simple first write wins policy without needing siblings and client conflict
resolution?

Cheers,
Jeremy
_______________________________________________
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com

Reply via email to