Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Couchdb database design options

Tags:

couchdb

  1. Is it recommended to have a separate database for each document type in couchdb or place all types of documents in a single database?
  2. Is there any limitation on the number of databases that we can create on couchdb?
  3. Are there any drawbacks in creating large number of databases in couchdb?
like image 519
malli Avatar asked Jul 26 '14 14:07

malli


People also ask

What type of database is CouchDB?

Apache CouchDB (CouchDB (link resides outside IBM)) is an open source NoSQL document database that collects and stores data in JSON-based document formats.

Is CouchDB document-oriented?

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.

What is CouchDB and list out its features?

CouchDB is a document storage NoSQL database. It provides the facility of storing documents with unique names, and it also provides an API called RESTful HTTP API for reading and updating (add, edit, delete) database documents. In CouchDB, documents are the primary unit of data and they also include metadata.


1 Answers

  1. There is no firm answer. Here are some guidelines:

    • If two documents must be visible to different sets of users, they must be in different DBs (read/write privs are per-DB, not per-doc).
    • If two documents must be included in the same view, they must be in the same DB (views are for a single DB only).
    • If two types of documents will be numerous and never be included in the same view, they might as well be in different DBs (so that accessing a view over one type won't need to process all of the docs of the other type).
    • It's cheap to drop a database, but expensive to delete all of the documents out of a database. Keep this in mind when designing your data expiration plan.
  2. Nothing hardcoded, but you will eventually start running into resource constraints, depending on the hardware you have available.

  3. Depends on what you mean by "large numbers." Thousands are fine; billions probably not (though with the Cloudant changes coming in v2.0.0 I'd guess that the reasonable cap on DB count probably goes up).

like image 108
Eli Stevens Avatar answered Oct 11 '22 15:10

Eli Stevens