This would have to be implemented in application space... Or an rdbms that
supports acid. Maybe a combination of the two.

@siculars
http://siculars.posterous.com

Sent from my rotary phone.
On Oct 28, 2011 8:56 PM, "Justin Karneges" <[email protected]> wrote:

> Hi,
>
> Suppose I've got a key A that points to a set of child keys.  What's the
> best
> way to add child key B and update the reference in A, without the DB
> becoming
> inconsistent in a fail case?
>
> I imagine I want to do:
>
>  set B (create the child)
>  get A (to fetch the original key set)
>  set A (resave A with an updated key set that includes B)
>
> However, if there's a failure applying the changes to A, then I end up with
> this orphaned B key with nobody pointing to it.  Should the client try to
> perform a rollback then?  That is, if setting A fails then delete B?  What
> if
> there's a failure to delete B?  Cron job garbage collectors that delete
> orphaned keys?  How can I not make a mess of my DB? :)
>
> I know this is probably a KV 101 question that applies to everything, not
> just
> Riak, but nothing obvious came up on Google...
>
> Justin
>
> _______________________________________________
> riak-users mailing list
> [email protected]
> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
>
_______________________________________________
riak-users mailing list
[email protected]
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com

Reply via email to