couchdb: one database per account vs all in one database w. a namespace / property

Posted by thruflo on Stack Overflow See other posts from Stack Overflow or by thruflo
Published on 2010-05-02T15:33:10Z Indexed on 2010/05/02 15:37 UTC
Read the original article Hit count: 132

Filed under:
|

I'm modelling a document generation system in couchdb. It semi-automates the production of proposal and presentation documents from managable document fragments.

Much like, say, Basecamp, it breaks down very simply into self-contained data per 'account'. Each account has multiple users, projects, documents, etc. However, nothing should be shared between accounts.

I can see two ways of doing this:

  • one couchdb database per account
  • use a namespace / property to identify the account

It seems to me that the first approach is conceptually sound and potentially has security and partitioning advantages. However, it seems to me to restrict some cross-database data querying (that I don't have a use case for now but you never know...) and to make updating views potentially require an awful lot of writes.

Does anyone experienced with this kind of decision have any advice?

© Stack Overflow or respective owner

Related posts about couchdb

Related posts about data-modeling