On Jun 9, 2010, at 2:59 PM, Vlad Mangeym wrote:

> Hi,
> 
> I am evaluating CouchDB to be used in multi-tenant environment and
> would like to know if there are ways to have design documents from one
> database to be used by a  another database.
> 
> In other words, if we have client1, client2, client3 databases that
> contain data (specific to a client) and application_code database that
> has design documents (views, validation rules) that should be used by
> all clients is there a way to point to the application_code db from
> other client data databases?
> 
> Otherwise, it would be difficult to do application code upgrades: one
> would need to replace design documents individually for each client...
> 
> Thanks.


Thanks for the question. I think I understand. Essentially, you want to have 
your code in one place, and the data in another, to avoid problems doing code 
updates to the client databases.

Currently this is not supported. CouchDB strives hard to avoid dependencies 
between databases. I think you'll have a more robust system in the long run if 
you keep a copy of the application in each client's database.

Keeping them up to date will be simple. Just setup continuous replication (with 
_admin privileges) from the application_code database to the client database. 
Then each time the application code database is updated, the client dbs will be 
kept up to date automatically.

Chris

Reply via email to