couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Couchdb Wiki] Update of "Transaction model use cases" by AndriusJuozapaitis
Date Fri, 10 Apr 2009 13:34:35 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:
http://wiki.apache.org/couchdb/Transaction_model_use_cases

------------------------------------------------------------------------------
  
  '''''The proper way to do this is treat CouchDB as a ledger, with each line item as a new
document. Then to do a transfer a single document that shows the money subtracted from account
A and added to account B. To get the balance of an account, create a view of transactions
by account and use a reduction to add up all the transactions for each account.'''''
  
+ 
+ == Users, groups and relationships ==
+ 
+ Documents: User, Group;
+ User has a list of group id's he belongs to. 
+ 
+ 1. A group X that is being referenced from multiple users is being deleted. (expected behavior
- all users referencing the group X are found, group reference is removed, user is saved into
database; when done, group X is deleted)
+ 2. A user that already references group X, is assigned to a new group, Y. 
+ 
+ if 2) happens somewhere in the middle of 1), results will be inconsistent, 
+ -that user will still contain a reference to the deleted group if we ignore this error
+ -a few users will be removed from the group, and some won't, if we break the operation when
the concurrent modification exception occurs. 
+ 
+ 
+ 
+ 
+ 
+ if 2) happens somewhere in the middle 
+ 

Mime
View raw message