Reputation: 6635
I am building a simple bookmarking application where users will have extensions installed in their browsers which will sync the local bookmarks into our app.
I am using CouchDB to store the user data. If scalability is what I am aiming at, they what is the best way to use CouchDB given the following options?
Anything else?
Upvotes: 9
Views: 1526
Reputation: 3461
A dedicated database-per-user is more important when you don't want other users to be able to read the contents of another user's database. This is because CouchDB cannot enforce read-permissions on a per document basis, only per database. The problem with creating many databases is that you cannot create Views that span across databases, Views can only operate on documents in a single database.
General rule of thumb: if privacy concerns of a user's data is not that important, use one big database.
Note: This only applies to CouchDB by itself. You can get around this permissions limitation if you have another layer of software in front of CouchDB, like a proxy or a web framework doing authentication.
Upvotes: 15