On Wed, Dec 16, 2009 at 10:16 PM, Jonathan Ellis <jbel...@gmail.com> wrote:
> On Wed, Dec 16, 2009 at 2:31 PM, gabriele renzi <rff....@gmail.com> wrote:
>> is there a fundamental reason for not being able to provide a
>> putIfAbsent-like abstraction in cassandra?
>
> Yes: there is no global master to serialize operations from multiple clients.
>

of course, but it's a similar trade off to eventually consistent
operations, imvho.

e.g., nodes A, B , C and clients x, y

if X gets to write on A, B , C before y everything is ok, and viceversa.

If two clients wrote on [A,B,C] in mixed order, there would be a
conflict when writing on tht others and both would fail, later on when
propagating information the nodes with different conditional puts
could remove both keys due to inconsistency.

The OP's original problem would then be solved by using this step in a
similar way to the first part of 2pc: if the first write succeeded
he'd have gained a lock on key K and could write the actual user
entry.

But yes, this is still better solved in other ways, I understand :)


-- 
blog en: http://www.riffraff.info
blog it: http://riffraff.blogsome.com

Reply via email to