http://www.mongodb.org/display/DOCS/Comparing+Mongo+DB+and+Couch+DB, 英文

http://www.searchdatabase.com.cn/showcontent_46595.htm, 中文

最根本的不同是, 应用场景的不同, 是对CAP的取舍的不同

MongoDB选择牺牲可用性来保证一致性和原子性, 而couchDB却是选择放弃一致性而保持高可用性, 所以CouchDB更像KV,nosql, 而MongoDB太象关系型数据库

We are getting a lot of questions "how are mongo db and couch different?"  It's a good question: both are document-oriented databases with schemaless JSON-style object data storage.  Both products have their place -- we are big believers that databases are specializing and "one size fits all" no longer applies.

We are not CouchDB gurus so please let us know in the forums if we have something wrong.

MVCC

One big difference is that CouchDB is MVCC  based, and MongoDB is more of a traditional update-in-place store.  
MVCC is very good for certain classes of problems:

  • problems which need intense versioning;
  • problems with offline databases that resync later;
  • problems where you want a large amount of master-master replication happening.

Along with MVCC comes some work too:

  • first, the database must be compacted periodically, if there are many updates.
  • Second, when conflicts occur on transactions, they must be handled by the programmer manually (unless the db also does conventional locking -- although then master-master replication is likely lost).

MongoDB updates an object in-place when possible.  Problems requiring high update rates of objects are a great fit; compaction is not necessary. Mongo's replication works great but, without the MVCC model, it is more oriented towards master/slave and auto failover configurations than to complex master-master setups.  With MongoDB you should see high write performance, especially for updates.

这个应该是最大的区别, MongoDB采用和传统DB类似的策略, update in-place, master/slave, auto failover. MongoDB的特点就是效率高, 尤其是update

而CouchDB就采用比较少见的, append-only方式, 可以支持, MVCC, master/master, 支持offline操作.

Horizontal Scalability

One fundamental difference is that a number of Couch users use replication as a way to scale.

With Mongo, we tend to think of replication as a way to gain reliability/failover rather than scalability.  Mongo uses (auto) sharding as our path to scalabity (sharding is GA as of 1.6).  In this sense MongoDB is more like Google BigTable.  (We hear that Couch might one day add partitioning too.)

这个也是CouchDB的一大弱点, 我不认为replication能算水平扩展的方法, 如果不支持partition的话...

Query Expression

Couch uses a clever index building scheme to generate indexes which support particular queries.  There is an elegance to the approach, although one must predeclare these structures for each query one wants to execute.  One can think of them as materialized views.

Mongo uses traditional dynamic queries.  As with, say, MySQL, we can do queries where an index does not exist, or where an index is helpful but only partially so.  Mongo includes a query optimizer which makes these determinations.  We find this is very nice for inspecting the data administratively, and this method is also good when we don't want an index: such as insert-intensive collections.  When an index corresponds perfectly to the query, the Couch and Mongo approaches are then conceptually similar.  We find expressing queries as JSON-style objects in MongoDB to be quick and painless though.

Update Aug2011: Couch is adding a new query language "UNQL".

MongoDB 与传统的数据库系统类似,支持动态查询,即使在没有建立索引的行上,也能进行任意的查询。而 CouchDB 不同,CouchDB 不支持动态查询,你必须为你的每一个查询模式建立相应的view,并在此view的基础上进行查询.

Atomicity

Both MongoDB and CouchDB support concurrent modifications of single documents.  Both forego complex transactions involving large numbers of objects.

都支持原子性修改.

Durability

CouchDB is a "crash-only" design where the db can terminate at any time and remain consistent.

Previous versions of MongoDB used a storage engine that would require a repairDatabase() operation when starting up after a hard crash (similar to MySQL's MyISAM). Version 1.7.5 and higher offer durability via journaling; specify the --journalcommand line option

CouchDB是append-only, 再加上两步commit, 可以保证数据的一致性, crash只会导致新数据的丢失, 而不会导致老数据的不一致.

MongoDB就和传统数据库一样, crash必然会导致数据不一致, 需要去repair

Map Reduce

Both CouchDB and MongoDB support map/reduce operations.  For CouchDB map/reduce is inherent to the building of all views.  With MongoDB, map/reduce is only for data processing jobs but not for traditional queries.

CouchDB的map/reduce只是用于单节点的view查询, 相当的水

而MongoDB, 用于多shard的数据统计, 相对靠谱一些

Javascript

Both CouchDB and MongoDB make use of Javascript.  CouchDB uses Javascript extensively including in the building of views .

MongoDB supports the use of Javascript but more as an adjunct.  In MongoDB, query expressions are typically expressed as JSON-style query objects; however one may also specify a javascript expression as part of the query.  MongoDB also supports running arbitrary javascript functions server-side and uses javascript for map/reduce operations.

简单的说, 就是用在不同的地方

REST

Couch uses REST as its interface to the database.  With its focus on performance, MongoDB relies on language-specific database drivers for access to the database over a custom binary protocol.  Of course, one could add a REST interface atop an existing MongoDB driver at any time -- that would be a very nice community project.  Some early stage REST implementations exist for MongoDB.

Performance

Philosophically, Mongo is very oriented toward performance, at the expense of features that would impede performance.  We see Mongo DB being useful for many problems where databases have not been used in the past because databases are too "heavy".  Features that give MongoDB good performance are:

  • client driver per language: native socket protocol for client/server interface (not REST)
  • use of memory mapped files for data storage, 所以非常耗内存
  • collection-oriented storage (objects from the same collection are stored contiguously)
  • update-in-place (not MVCC)
  • written in C++

Use Cases

It may be helpful to look at some particular problems and consider how we could solve them.

  • if we were building Lotus Notes, we would use Couch as its programmer versioning reconciliation/MVCC model fits perfectly.  Any problem where data is offline for hours then back online would fit this.  In general, if we need severaleventually consistent master-master replica databases, geographically distributed, often offline, we would use Couch.
  • mobile
    • Couch is better as a mobile embedded database on phones, primarily because of its online/offine replication/sync capabilities.
    • we like Mongo server-side; one reason is its geospatial indexes.
  • if we had very high performance requirements we would use Mongo.  For example, web site user profile object storage and caching of data from other sources.
  • for a problem with very high update rates, we would use Mongo as it is good at that because of its "update-in-place" design.  For example see updating real time analytics counters
  • in contrast to the above, couch is better when lots of snapshotting is a requirement because of its MVCC design.

Generally, we find MongoDB to be a very good fit for building web infrastructure.

本文章摘自博客园,原文发布日期:2012-07-02

Comparing Mongo DB and Couch DB相关推荐

  1. 大型网站的负载均衡器、db proxy和db

    大型网站的负载均衡器.db proxy和db 本文主要分析网站后台架构中的负载均衡器,企业常用的硬件负载均衡器软件负载均衡器.数据库代理服务器和数据库. 1.1 负载均衡 在大型网站部署中,负载均衡至 ...

  2. [Android]DDMS查看app保存的Sqlite数据库db文件和db升级

    [Android]DDMS查看app保存的Sqlite数据库db文件和db升级 @Author GQ 2017年06月06日 项目的app中大多需要用到本地sqlite存储,所以需要看到自己是否保存成 ...

  3. tp5.1 db助手与db::name混合使用数据库操作失效

    tp5.1 db助手与db::name混合使用数据库操作失效 首先说明下db助手与db::name,db::table的区别 db助手,每次使用都会重新创建数据库连接,db::name,db::tab ...

  4. (转)大型网站的负载均衡器、db proxy和db

    大型网站的负载均衡器.db proxy和db 本文主要分析网站后台架构中的负载均衡器,企业常用的硬件负载均衡器软件负载均衡器.数据库代理服务器和数据库. 1.1 负载均衡 在大型网站部署中,负载均衡至 ...

  5. dB HL与dB SPL含义与区别

    dB HL与dB SPL含义与区别 转载▼ 1.大家知道,分贝是用来表示声音强度大小的单位,在物理声学上,它是以测量点的声压P除以基准声压Pr,然后通过对数计算得出的,即: 其中"SPL&q ...

  6. rake db:migrate db:reset和db:schema:load之间的区别

    本文翻译自:Difference between rake db:migrate db:reset and db:schema:load The difference between rake db: ...

  7. 史上最全的dB分贝单位合集: dB,dBFS, dB FS, dBTP, dB TP, dBO, dBov, dBu/dBv, dBV, dBm/dBmW, dBW,...

    dB 数值范围根据实际测量的参考值有变化.计算能量: 计算场量: 领域 电压 dBu/dBv dBmV dB(1 mVRMS)–电压相对于75 Ω阻抗上的1毫伏.[16]广泛用于有线电视网,其接收端的 ...

  8. python中的一个现象,db.commit和db.commit()

    假设有一个表,有自增字段,在开发环境中(sublime/Liclipse等)执行insert语句时,如果调用db.commit,那么数据库中不会有这条记录,但也不报错,再次插入成功时,自增自段加1. ...

  9. 关于IT结合测试,事前DB与事后DB的问题(之一:如何能更好的看出更新效果)。

    我们在进行结合测试时,跑完一个流程,常常需要对比数据. 这就需要值数据库表里的数据,和更新之后的值是不同的,这样才能看出更新的效果. 在导出事前DB时,我们一定要注意看一下事前DB中,里面需要确认的字 ...

  10. matlab db dbm dbfs,dB

    关于dB的所有事 dB,dBm,dBw,dBi,dBFS,dBSPL,dBu,dBV 1.dB 分贝(dB):通常表示两个声音信号或电力信号在功率或强度方面的相对差别的单位,相当于两个水平的比率的常用 ...

最新文章

  1. 可租赁、可定制的虚拟人居然还能这么玩?9月25日来百度大脑人像特效专场一探究竟!...
  2. python timer使用-Python timer定时器两种常用方法解析
  3. Asp.Net异常:由于代码已经过优化或者本机框架位于调用堆栈之上,无法计算表达式的值的解决方法...
  4. 如何用阿里云容灾服务(HDR)为本地数据中心提供极致保护...
  5. centos rpm mysql 5.6_centos6.5 mysql5.6 RPM安装
  6. 使用DB2的with as 语句 实现树的递归查询
  7. python django前端重构_django修改models重建数据库的操作
  8. 扩大mysql的cpu_MySQL CPU占用超过100%
  9. EDEM基础操作步骤
  10. Python 简易实现 quoted-printable 编码
  11. Direct3D初始化失败的原因
  12. 2012MDCC中国·移动开发者大会 邀请函
  13. 由魅族16到Reno5新机的转变!绿厂凭这几点吸引了我
  14. (Java) 实现打印菱形图案
  15. KindEditor实现多图片上传
  16. Android Telephony框架结构简析
  17. 8月清北学堂培训 Day4
  18. 良知的清醒常常意味着糟糕的记忆力的标志。
  19. arduino nano电路图
  20. CppCheck使用说明

热门文章

  1. python之文件处理
  2. 视频网站盈利模式与营销策划
  3. passenger+nginx框架部署
  4. Low-Light Image and Video Enhancement Using Deep Learning: A Survey 论文阅读笔记
  5. 第二章 复杂的HTML解析(上)
  6. Peta数据集识别性别
  7. 目标检测入门(一)两阶段目标检测的由来
  8. 亮相SIGGRAPH 太极拳三维教学App制作揭秘
  9. 选择与循环:剪刀石头布_剪刀石头布十大奢侈家具,创造高端精致生活就是这么简单!...
  10. 陈莉君教授: 回望踏入Linux内核之旅