CouchDB is open-source document-oriented database system, which is written in Erlang programming language and designed for simple horizontal scalability and local replication throughout different devices. Commercial subjects as CouchBase and Cloudant support CouchDB.

Principle of CouchDB

CouchDB is in some areas relatively similar to other document storages as are e. g. MongoDB or Lotus Notes. Instead of saving data in lines and columns following the example of relational database systems, it manages CouchDB collections of JSON documents. Documents belonging to collections don’t share the scheme together. The query capacities are offered through views. Views define aggregation functions and are filtrated comparably to e. g. at MapReduce.

Views are typically stored in database and their indexes are being continuously renewed. Although some queries can result in temporary views. CouchDB supports system, which mediates views through external socket servers and with the usage of protocols built on JSON. It allows servers to be created in many varied languages.

CouchDB is established on RESTful http API, to which are many freely available clients. Furthermore, with the help of plugin architecture is possible to achieve the usage of different languages for view servers. As example can be used default JavaScript, Perl, Ruby, Python, PHP or Erlang. Support for other languages can be easily added. CouchDB proposal and its philosophy comes fully from Web architecture in the area of concept, sources and methods.

CouchDB uses many software projects and websites. As example can be used Ubunt distribution, where it serves for directory’s saving or synchronization, Tomboy, where it serves for notes or Firefox bookmarks with the use of one.ubuntu.com service.

Features of CouchDB

  • Document storage. CouchDB stores whole documents.
  • ACID Transactions. As many relational database systems, CouchDB offers ACID transactions.
  • Distributed architecture with support of replication. CouchDB is designed to support bidirectional replication or synchronization. It leads to occurrence of multiple replica, which have own copies of the same data, which they modify and only then synchronize. In this case, the risk can be the emergence of conflicts.

Advantages of using CouchDB

  • Document model. Document model is suitable for many applications in real life. It is simple to serialize objects into JSON files, save them and then to deserialize them, when we need them again. It is possible to index and search in files’ content.
  • Easy REST API.
  • Relatively simple storing of more nodes. It is possible to use the same data for replication and even for optimization with large datasets.

Disadvantages of using CouchDB

  • Data are stored in JSON file. It means that files are relatively large. Also, the descriptive structure of names can even increase the size of the file.
  • Full-text search. CouchDB doesn’t have any built-in full-text searching. There are options with the use of couchdb-lucene or elasticsearch.
  • It doesn’t support transactions. Usual operations as requiring unique user name or increasing value and their restoring can be unsafe.
  • Relational data. If we have data, which make sense in relational database and store them to CouchDB, we’ll probably come across many problems.
  • Data warehouses. Temporary views over large datasets are very slow.
  • Often actualized data. CouchDB is not designed to work with often actualized data.