I've created a single page app that is going to be used by different commercial parties and was wondering what are the best practices to divide the databases.

Currently I think of one database per commercial party (with possibly different users all having the same access rights).

In the future I might split up some databases into one database per subdivision. I'm not really tempted by creating one database per user, especially because i need to have somewhat logical/maintainable url's (from both an aesthetic and an administrators point of view) and like to use the e-mail addresses of users for their usernames so there is no direct mapping from username to database name (since @ and . are not allowed in a database name, apart from the fact that the url starts looking unacceptably bad with usernames in it).

All apps need authentication so I've setup a public database hosting the jquery.couchLogin.js app which asks, after successful authentication, for a custom "usertodb" document from the public database. This document hosts a mapping between usernames and database names. Then this public app redirects to the corresponding url and/or db.

Currently I'm not sure whether to use different domains/subdomains per database or subdirs.

I'd like to hear experiences/best practices/feedback from other people who had a somewhat similar case, since this is my first couchdb project.

ps. I'd need couchdb-lucene to work with the setup, up till now I only tested it on a single db.

Reply via email to