Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When do I use a separate CouchDB database?

Tags:

couchdb

I'm designing a system based around CouchDB. It will have a handful of different components - a list of users, a main data store, logging, etc. What I want to get a feel for is, what should the scope of a CouchDB database be? Should I have separate databases for each component, or just chuck everything into one and use a 'type' property for each document? I know individual databases can get very large quite happily, but is the performance of views impacted by keeping everything in one database, as opposed to splitting databases out? Essentially, what are the trade-offs involved?

Cheers all.

like image 608
stompydan Avatar asked Feb 04 '11 10:02

stompydan


People also ask

Is CouchDB still relevant?

Currently, we use CouchDB in various projects throughout our Big Data Insight Product Division for development and production environment setup. Mainly it is being used to store serialized (JSON formatted) unstructured data.

Why should you use CouchDB?

The architectural design of CouchDB makes it extremely adaptable when partitioning databases and scaling data onto multiple nodes. CouchDB supports both horizontal partitioning and replication to create an easily managed solution for balancing both read and write loads during a database deployment.

Is CouchDB a distributed database?

CouchDB is a peer-based distributed database system. It allows users and servers to access and update the same shared data while disconnected.

Where is CouchDB data stored?

Configuration Backups. CouchDB's configuration system stores data in . ini files under the configuration directory (by default, etc/ ). If changes are made to the configuration at runtime, the very last file in the configuration chain will be updated with the changes.


1 Answers

Good question, Dan.

I think this is basically an optimization problem. A good idea is not to optimize (separate into multiple databases) too soon. (One exception might be logs, which can quickly dominiate all other data, requiring compaction often. I might split the logs off immediately.)

View performance will not be impacted. In exchange for pre-defined queries (view definitions), CouchDB guarantees fast view results, always.

Whether to split into multiple databases typically depends on authentication and permission concerns. If you use a normal web server front-end, that is less of a concern.

As with all views, they are fine if you query often. Queries keep the view up-to-date, with fast response time. Delays in the query cause processing to build up for the next one. In production, this is not much of a problem.

like image 187
JasonSmith Avatar answered Oct 04 '22 20:10

JasonSmith