-
Notifications
You must be signed in to change notification settings - Fork 308
spike out CouchDB for storing funds as json #488
Comments
https://gist.github.com/4572217 [Replaced inline paste with link to gist. —ed.] |
In the sample JSON file I made up above the "id" there is not the same as the official CouchDB document "_id". There are 9 there documents in total. I implemented each fund as one document completed with it's entries embedded in the document. As a quick start prototype, check out to the JSON map the fund ids -> Child item ids: Then check out to see [Resource/Currency, Fund ID, Child ID] -> shares: Then check out to the shares version reduced down to weights (aka percentages): What I don't have working at the moment here are the steps to further reduce the child IDs until the only thing left are direct user ids and a cumulative percentage based on the whole hierarchy. For the moment, it simply takes each fund document and creates a percentage weight of its entries. |
This is more complex than the simple example on https://github.com/zetaweb/www.gittip.com/issues/449#issuecomment-12330669, though you're almost certainly right that we're going to want more info in there. Can we come back to this when we have the UI and API spec'd out further? |
After some initial experiments and some good results, I hit a wall when I went to calculate the percentages iteratively. It turns out that to do the recursive iterations Map/Reduce isn't well suited to the kinds of operations I was trying to do. :) After talking to some folks, reading some blogs, and pouring over a few different web sites. I've no experience doing graph based queries, so that's not so good - however the neo4j folks have put together some great tutorials and some nice query languages, so that's good again. I'm going to take a two phase approach here: |
Reticketing from #449. @MikeFair: Go ahead and assign this one to yourself to pick this up.
The text was updated successfully, but these errors were encountered: