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?
CouchDB is a peer-based distributed database system.
Apache CouchDB (CouchDB (link resides outside IBM)) is an open source NoSQL document database that collects and stores data in JSON-based document formats.
By default, the database files are located under /var/lib/couchdb directory (this location will be specified in the couchdb config file under /etc/couchdb directory). In CouchDB, each database is wholly contained in a single append-only file.
Apache CouchDB is an open-source document-oriented NoSQL database, implemented in Erlang. CouchDB uses multiple formats and protocols to store, transfer, and process its data. It uses JSON to store data, JavaScript as its query language using MapReduce, and HTTP for an API.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With