arm1.ru

Differences Between CouchDB and Couchbase

Translation of an answer on stackoverflow.com to the question about the differences between CouchDB and Couchbase.

I think there are some essential differences between CouchDB and Couchbase Server that need to be pointed out.

I will not write about the advantages of switching from CouchDB to Couchbase Server because those are described pretty much everywhere (see The Future of CouchDB by Damien Katz or Couchbase vs. Apache CouchDB by Couchbase). Instead, I will try to enumerate features of CouchDB that you will not find in Couchbase Server.

Names and confusion

There is CouchDB, CouchIO, CouchOne, Couchbase, Couchbase Server, Couchbase Mobile, Couchbase Lite, CouchApps, BigCouch, Touchbase, Membase, Memcached, MemcacheDB... all different and yet related, obviously not only by name.

First, there was CouchDB, a database created by Damien Katz, a former IBM developer. Its official name changed to Apache CouchDB after it became an Apache project.

A company named CouchIO was founded to work on Apache CouchDB and later changed its name to CouchOne (I mean the company name, not the database name).

CouchOne (formerly CouchIO) merged with Membase (formerly NorthScale) to form a new company called Couchbase. Membase (the company) developed Membase (a product of the same name). Membase was created by several leaders of the Memcached project and used the Memcached protocol. After the merger of CouchOne and Membase, Couchbase continued developing the Membase software and later changed its name to Couchbase Server.

Today, I think most people believe that Couchbase Server is a new version of CouchDB, but in fact it is a new version of Membase. It still uses the Memcached protocol and does not use CouchDB's REST API. Meanwhile, CouchDB is still CouchDB, actively maintained and developed as an Apache project.

Now to the relevant differences:

Licensing

Couchbase Server is not entirely open-source/free software. There are two versions: Community Edition (free but without the latest bug fixes) and Enterprise Edition (there are restrictions on usage, confidentiality provisions, audits by Couchbase Inc. that «will be conducted during regular business hours at Licensee's facilities», and other terms typical of proprietary software that many people may find unacceptable).

CouchDB is open-source/free software (no strings attached), a project of The Apache Software Foundation, and is distributed under the Apache License, Version 2.0 (DFSG-compatible, FSF-approved, OSI-approved, GPL-compatible, non-copyleft, commercial-friendly).

Philosophy

I have never seen this pointed out directly, but it may actually be the biggest difference between these two databases because it is about the philosophy of distributed computing models and not just certain features, APIs, or licensing. CouchDB and Couchbase Server are completely different in their views on building distributed systems and databases.

According to the CAP theorem (consistency, availability, partition tolerance), it is impossible for a distributed database to simultaneously provide consistency, availability, and partition tolerance.

CouchDB is an AP-type system (provides availability and partition tolerance)

Couchbase Server is EITHER a CP-type system (according to Wikipedia) OR a CA-type system (according to the Couchbase technical update) — WHICH OF THESE IS CORRECT? PLEASE COMMENT.

Features

Here is what I considered worth pointing out from the list of CouchDB features that are not supported by Couchbase Server:

  • no REST API (only for views, not for CRUD (create read update delete) operations);
  • no _changes feed;
  • no peer-to-peer replication;
  • no CouchApps;
  • no Futon (a different administration interface is available);
  • no Document IDs (_design/ or _local/);
  • no notion of databases (only buckets);
  • no replication between a CouchDB database and Couchbase Server;
  • no explicit attachments (you will have to store attached files as a new key/value pair);
  • no HTTP API for everything (you need to use the Couchbase Server SDK or one of the experimental client libraries in Couchbase Develop, so no experiments with curl and wget);
  • no CouchDB API (the Memcached API is used instead);
  • you cannot do everything you want from the browser (you will have to write a server-side application);
  • two-tier architecture for web applications is impossible (you will have to write a server-side application to sit between the browser and the database, as with relational databases);
  • no eventual consistency;
  • not entirely open-source/free software;
  • not a full replacement for CouchDB (it looks more like a replacement for Memcached).

These CouchDB capabilities may or may not be important to you, so whether their absence is a disadvantage or not is strictly subjective. But I think the decision whether to switch from CouchDB to Couchbase Server should be based on these differences and on whether you depend on these capabilities in your current CouchDB-based implementation.

For example, if you became interested in CouchDB after watching the changes in CouchDB talk at NodeCamp by Mikeal Rodgers or one of the CouchApp tutorials by J. Chris Anderson, you should realize that if you want to switch to Couchbase Server, you will have to forget quite a lot of what they were talking about.

Because of that, I would say that Couchbase Server looks like an evolution of Memcached and Membase (not an evolution of CouchDB), and therefore looks like a good product if you are already using Memcached and Membase. If you use CouchDB only for the simplest tasks, you can consider using Couchbase Server for them and it may work better (if you do not care about the licensing restrictions). But if you use any features that are unique to CouchDB (for example, changes feed, CouchApps, two-tier architecture, peer-to-peer replication, and so on), then you should either forget about them or stay with CouchDB. In any case, make sure you read and understand the migration guide for CouchDB users to Couchbase before you think about switching.

People often get the wrong impression (perhaps after reading something like «What is the future of CouchDB? The future is Couchbase») that CouchDB is somehow obsolete compared to Couchbase Server, or that it is an old version of Couchbase. Meanwhile CouchDB is an actively developing open-source project, Couchbase Server is a completely separate project (it is a newer project, but it is not a new version of CouchDB — they are not even compatible), and since even new tools for creating CouchApps are still being developed (for example, the Kanso project), CouchDB is not going anywhere anytime soon.

I hope this helps clear things up. Please correct me if I am wrong anywhere.

Update:

Couchbase Server is actually the new name for Membase Server (it was renamed to Couchbase Server somewhere around version 1.8). Take a look at the Couchbase 2011 review:

Unfortunately, we confused the hell out of many of our users. In addition to Membase Server and our new mobile products, we also offered Couchbase Single Server, which was a packaged distribution of Apache CouchDB.

On top of that, we began releasing developer previews of Couchbase Server 2.0, which incorporated CouchDB technology into Membase Server — but this product was not compatible with Couchbase Single Server (or CouchDB). [...] Membase Server will be renamed to Couchbase Server 1.8 in its next January release — a small step to ease the confusion around the name. As planned from the very beginning, the Couchbase Server 2.0 release (currently Developer Preview 3) will add index and query functionality. While Couchbase Server 2.0 will include a substantial part of the technologies from the CouchDB project, it will not be backward compatible with CouchDB and should not be viewed as a «version of CouchDB».

keyboard_return