CouchDB

Apache CouchDB is a database that uses JSON for documents, JavaScript for MapReduce indexes, and regular HTTP for its API

Apache CouchDBApache CouchDB is an open source database that “completely embraces the web”. It provides a great number of features, including multi-master replication and eventual consistency, easy-to-use web administration console, on-the-fly document transformation and real-time change notifications. CouchDB works great with web and mobile apps due to incremental replication and automatic conflict detection. CouchDB includes both REST API and Futon - a built-in administration interface accessible through the web.

This database is built on the Erlang OTP platform, since it is specifically aimed at massively scalable real-time systems and its robust, concurrent nature is well suited for a database server. Using Erlang CouchDB provides lock-free concurrency and capability to work predictably under heavy loads, so that high volume of concurrent readers and writers can be handled without conflict.

CouchDB is usually categorized as a NoSQL database. It means that, unlike a relational database, it does not store data and relationships in a rigid pre-defined data structures such as tables. Each database is stored as a collection of JSON documents. Each document is independent, maintains its own data, and its metadata stores revision information. Document structure can change dynamically to fit specific needs.

CouchDB database contains documents with unique ids and does not require document schema. These documents can be accessed with the web browser via HTTP; indexed, combined, and transformed with JavaScript. The stored JSON documents are structured using views. Views are defined by a JavaScript functions and filters that act as the Map half of a map/reduce operation. CouchDB indexes views and keeps those indexes updated while documents are added, removed, or modified.

CouchDB features a form of Multi-Version Concurrency Control and Atomic Consistent Isolated Durable (ACID) semantics. They ensure consistency, because CouchDB never overwrites committed data or associated structures and a lot of clients can work simultaneously: replicating changes, opening and updating documents, and querying views, without needing locks.

CouchDB is particularly suited for offline operation. It is very useful, for instance, for mobile devices, where network connection is not always present but the application has to work all the time. In this case databases are replicated to devices, modified there, and synchronize data changes later when the device is back online. CouchDB guarantees eventual consistency, thus is highly available and partition tolerant. Master-master replication allows easy multi-site deployments.

CouchDB is popular an open source database, perfect for apps with accumulating, occasionally changing data, where versioning and data safety are essential. Find more features on couchdb.apache.org.

Connect with our experts Let's talk