Apache CouchDB


Apache CouchDB, commonly referred to as CouchDB, is an open source database that focuses on ease of use and on being a database that completely embraces the web. It is a NoSQL database that uses JSON to store data, JavaScript as its query language using MapReduce, and HTTP for an API. One of its distinguishing features is multi-master replication.

A NoSQL DB for the web!

Apache CouchDB Services

CouchDB stores data as documents, as one or more field/value pairs expressed as JSON. Field values can be simple things like strings, numbers, or dates; but ordered lists and associative arrays can also be used. Every document in a CouchDB database has a unique id and there is no required document schema.

Stored as documents with unique ID

CouchDB provides ACID semantics. It does this by implementing a form of Multi-Version Concurrency Control, meaning that CouchDB can handle a high volume of concurrent readers and writers without conflict.

High volume, no conflict

The stored data is structured using views. In CouchDB, each view is constructed by a JavaScript function that acts as the Map half of a map/reduce operation. The function takes a document and transforms it into a single value which it returns. CouchDB can index views and keep those indexes updated as documents are added, removed, or updated.

Fast indexing for entire document

CouchDB was designed with bi-direction replication and off-line operation in mind. That means multiple replicas can have their own copies of the same data, modify it, and then sync those changes at a later time.

Sync whenever

All items have a unique URI that gets exposed via HTTP. REST uses the HTTP methods POST, GET, PUT and DELETE for the four basic CRUD operations on all resources.

Fully ready for web use with standard protocols

CouchDB guarantees eventual consistency to be able to provide both availability and partition tolerance.

Guaranteed consistency

CouchDB Uses and Production

Replication and synchronization capabilities of CouchDB make it ideal for using it in mobile devices, where network connection is not guaranteed but the application must keep on working offline.

CouchDB is well suited for applications with accumulating, occasionally changing data, on which pre-defined queries are to be run and where versioning is important. Master-master replication is an especially interesting feature, allowing easy multi-site deployments.

Built-in administration interface accessible via web

Unlike in a relational database, CouchDB does not store data and relationships in tables. Each database is a collection of independent documents. Each document maintains its own data and self-contained schema. An application may access multiple databases, such as one stored on a user’s mobile phone and another on a server. Document metadata contains revision information, making it possible to merge any differences that may have occurred while the databases were disconnected.

© Copyright 2012 - Acumen Consulting - St. Louis