CouchDB和Couchbase之间有什么本质区别吗?


我认为CouchDB和Couchbase Server之间有一些需要指出的本质区别。

我不会写从CouchDB切换到Couchbase Server的优点,因为这些优点到处都有描述(参见Damien Katz的《CouchDB的未来》或 Couchbase vs Apache CouchDB 他)。相反,我将尝试列举CouchDB在Couchbase Server中找不到的特性。

所有与CouchDB和Couchbase相关的名称都很容易混淆,所以我更新了这个答案,首先简要解释最重要的名称。

名字和混淆

CouchDB, CouchIO, CouchOne, Couchbase, Couchbase Server, Couchbase Mobile, Couchbase Lite, CouchApps, BigCouch, Touchbase, Membase, Memcached, MemcacheDB…所有这些都不同,但仅从名字上看,它们之间的联系并不明显。

首先是CouchDB,一个由前IBM开发人员Damien Katz创建的数据库。在成为Apache项目后,它的正式名称更改为Apache CouchDB。

一家名为CouchIO的公司成立于Apache CouchDB上,后来更名为CouchOne(这里的“它的名字”指的是公司名称,而不是数据库名称)。

CouchOne(原CouchIO)与Membase(原NorthScale)合并,成立了一家名为Couchbase的新公司。Membase(该公司)开发了Membase(同名产品)。Membase是由Memcached项目的几位领导者创建的,它使用Memcached协议。CouchOne和Membase合并后,Couchbase继续开发Membase软件,后来更名为Couchbase Server。

今天,我想大多数人都认为Couchbase Server是CouchDB的新版本,但实际上,它是Membase的新版本。它仍然使用Memcached协议,而不是CouchDB的RESTful API。同时,CouchDB仍然是CouchDB,作为Apache项目积极地维护和增强。

现在说说相关的区别:

许可

Couchbase Server并非完全开源/免费软件。有两个版本:社区版(免费,但没有最新的错误修复)和企业版(有使用限制,保密条款,Couchbase Inc.的审计“将在被许可方设施的正常营业时间进行”,以及许多人可能无法接受的专有软件典型条款)。

CouchDB是Apache软件基金会的一个开源/免费软件(没有附加条件)项目,在Apache许可证2.0版本下发布(dfsg兼容,fsf批准,osi批准,gpl兼容,非copyleft,商业友好)。

哲学

我从来没有看到有人直接指出这一点,但这可能是这两个数据库之间最重要的区别,因为它深刻地体现了分布式计算模型的基本理念,而不仅仅是某些特性、api或许可。CouchDB和Couchbase Server在构建分布式系统和数据库的理念上完全不同。

根据CAP定理,分布式数据库不可能同时提供一致性、可用性和分区容差。

CouchDB是一个AP类型的系统(提供可用性和分区容忍)。

Couchbase服务器要么是CP类型的系统(根据维基百科),要么是CA类型的系统(根据Couchbase技术更新)-这两个中哪个是正确的?请发表评论。

特性

下面是我发现的CouchDB服务器不支持的特性列表:

no RESTful API (only for views, not for CRUD operations) no _changes feed no peer-to-peer replication no CouchApps no Futon (there is a different administration interface available) no document IDs no notion of databases (there are only buckets) no replication between a CouchDB database and Couchbase Server no explicit attachments (you have to store additional files as new key/value pairs) no HTTP API for everything (you need to use the Couchbase Server SDKs or one of the Experimental Client Libraries at Couchbase Develop so no experiments with curl and wget) no CouchDB API (it uses the Memcached API instead) you can't do everything from the browser (you have to write a server-side application) no two-tier architecture for Web apps is possible (you have to write a server-side application to sit between the browser and the database, like with relational databases) no eventual consistency not entirely open-source/free software not a drop-in replacement for CouchDB (seems like a drop-in replacement for Memcached instead)

CouchDB的这些特性对你来说可能重要,也可能不重要,所以缺少这些特性是不是一个缺点完全是主观的,但是我认为决定是否从CouchDB切换到Couchbase Server应该基于这些差异,以及你在当前CouchDB部署中对这些特性的依赖程度。

例如,如果你在看了Mikeal Rogers的关于CouchDB变化的NodeCamp演讲或J. Chris Anderson的CouchApp教程后对CouchDB感兴趣,那么你必须意识到,如果你想切换到Couchbase服务器,那么你将不得不忘记他们谈论的几乎所有事情。

Because of that, I would say that Couchbase Server looks like an evolution of Memcached and Membase (not an evolution of CouchDB) and as such it looks like a great product if you are currently using Memchached or Membase. If you are using CouchDB in the most basic way then you may consider using the Couchbase Server for the same things and it may or may not perform better (if you don't mind the license restrictions). But if you are actually using any of the features that are unique in CouchDB (like the changes feed, CouchApps, two-tier architecture, peer-to-peer replication etc.) then you can either forget about those features or stay with CouchDB. In any case, make sure to read and understand the Migration to Couchbase for CouchDB Users tutorial before you think about switching.

People often get the wrong impression (maybe after reading things like "What's the future of CouchDB? It's Couchbase.") that CouchDB is somehow obsoleted by the Couchbase Server, or that it is an old, legacy version of Couchbase. Meanwhile CouchDB is an actively maintained open-source project, Couchbase server is a completely separate project (it is a newer project but it is not a newer version of CouchDB - they are not even compatible) and since even new tools for creating CouchApps still keep being developed (eg. see the Kanso project) then CouchDB is not going anywhere soon.

我希望它能澄清困惑。如果我写错了什么,请指正。

更新:

Couchbase Server实际上是Membase Server的一个新名称(Membase Server在1.8版本左右被重命名为Couchbase Server)。参见Couchbase 2011年回顾:

Unfortunately, we confused the heck out of many of our potential 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 Couchbase Server 1.8 on its next release in January – a tiny step that simply alleviates “name” confusion. As has been planned from the beginning, the Couchbase Server 2.0 release (currently at Developer Preview 3) will add index and query functionality. While Couchbase Server 2.0 will incorporate substantial technology from the CouchDB project, it will not be upward compatible with CouchDB and it shouldn’t be viewed as a “version of CouchDB.” [emphasis added]

参见:

对Damien Katz的“CouchDB的未来”的评论(2012年删除-可在Web Archive中找到) 对Damien Katz“为什么是Couchbase?”的评论(2012年删除-可在Web Archive中找到) Couchbase 2011年度回顾 Membase服务器现在是Couchbase服务器 Couchbase技术更新 Cloudant和CouchOne的区别

它们是不同但相似的软件。我将上面答案的内容重新组合成一张图片,这可能有助于澄清“差异”以及共同之处:

Matt Ingenthron的评论补充道:

补充一些背景信息/更正:NorthScale的创始人是Steve Yen和Dustin Sallings。公司成立后不久我就加入了。此外,达米安后来没有加入Couchbase,他在合并前是CouchIO/Couch One的一部分。引用一个有趣的历史来源:https://youtube.com/watch?v=aZ_JOnU8tkI

我认为CouchBase似乎被认为是CouchDB的“企业”替代品。这在某种程度上似乎是正确的。 除了缺乏将文件附加到记录(文档)和与CouchDB相比的“开箱即用”REST端点的能力之外,CouchBase有类似sql的语言,即N1QL(有时发音为Nickel, UPDATE在CouchBase 7.0中重命名为sql ++)。 这就是我不喜欢/不推荐使用“NoSQL”这个术语的原因之一。我个人喜欢“非关系型”这个词。