Alex, This is a very common requirement with couchapps. Unfortunatly, it really has not been solved generically. I know someone on this list had posted some tool that would pretty much do this, but I was unable to find the post from a quick search. Maybe if they are still subscribed, they can speak up.
If you want to dabble in node.js, it's pretty easy to get going these days, and you can use Jason Smiths follow library. Max Ogden has a pretty good example with his datacouch here: https://github.com/maxogden/datacouch/blob/master/processors/provision/provision_databases.js You will have to tweek it a bit. Max might be able to show you the bits to change to make it a little more generic. Hope this gets you going! Ryan On Wed, Jan 11, 2012 at 9:18 AM, Alexander Gabriel <[email protected]> wrote: > Hi > > I have a couchapp hosted on iriscouch ( > http://barbalex.iriscouch.com/evab/_design/evab/index.html). > My users should only be able to read their own documents. > Additionally there are public documents that need to be pulled from a > central database (roughly 23 megabytes!). > Additionally some of the user documents should be written to the central > database. > > I understand the way to do this is: > > 1. User signs up > 2. this generates a doc > 3. external software listens to the _changes feed sees the doc. It > creates the database, assigns the user as admin, configures continuous > filtered replication from and to the central database > 4. the user is handed over to this database (couchapp) > 5. I guess I will have to tell the user to wait until all public > documents have replicated > > > These are my questions: > > - How can I implement the external software? > - How can I make sure that it is always running? > - How can the brand new user database tell when all the public documents > have been replicated so it can inform the user? It can't do anything anyway > before the design doc hasn't been replicated. So that would have to be > replicated first > - Are there articles/tutorials/examples showing this? > > I'm a novice and so far I only have some experience with javascript and > couchdb. Would be great if this could be done using that knowledge. Can the > external software also be a couchapp, maybe integrated into the central > database? > > Well, that is plenty asked. If I manage to pull this through I would gladly > add an article to the wiki. > > Alex
