couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <>
Subject [Couchdb Wiki] Update of "Transaction model use cases" by AndriusJuozapaitis
Date Mon, 13 Apr 2009 23:06:36 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Couchdb Wiki" for change notification.

The following page has been changed by AndriusJuozapaitis:

  '''''Put the user into an "about to delete" state. Then remove the user from all groups,
then completely delete the user. To deal with failures in the process, periodically search
for users in the "about to delete" state and remove them from all groups, then delete the
user. This is how Lotus Notes handles it.'''''
+  == Client content publishing system == 
+ There's a MMO community portal, where users are able to publish their own content. The content
is moderated. The users might get one of a few bonuses for publishing good articles, i.e.,
30 pieces of virtual silver. Articles might be pretty big (with attachments and such), so
you can't embed them directly into the user document. The user has a log of transactions,
that specify what bonuses and when he received, with reference to the article id. Transaction
log can't be moved to the article document either, because it may contain any type of micro-payments
to and by the user. 
+  1. User writes an article, and submits it; 
+  2. Moderator approves it; user receives a bonus. 
+ At least 2 documents are updated: user gets a piece of gold, and the article status is updated
to 'available to all'. A parallel update on user object, say a password change, or database
crash, leaves the db state inconsistent, with the user missing out on his payment. 
+ Alternative use case:
+ Each user has to be invited by someone to be able to register. Hence, all users participate
in a 2nd-tier bonus program, and they also get an additional 10% (3 pieces of silver) for
the content their invitee generated. This needs to be reflected in their transaction log.
Once again, database crash or any concurrent access violation screws up the whole math. 

View raw message