Http://blog.nosqlfan.com/html/1519.html
This article is in the official MongoDB website, MongoDB and CouchDB very similar, they are document-type storage, data storage format is JSON type, all use JavaScript to operate, all support map/reduce. But in fact, there are many essential differences between the two, this article through the phenomenon to pursue the essence, so that you better understand MongoDB and couchdb. Nosqlfan translation is as follows:
Original link: Comparing Mongo db and Couch db
1.MVCC (multiversion concurrency control)
One of the big differences between MongoDB and CouchDB is that CouchDB is a MVCC system, and MongoDB is a update-in-place system. The difference between the two is that MongoDB write operations are done in real-time write operations, the write operation is successful, the data is written successfully, and couchdb a support multi-version control system, such systems usually support multiple node write, The system detects the conflicts between the writes of multiple systems and resolves them with certain algorithm rules.
2. Horizontal Extensibility
In terms of extensibility, CouchDB uses replication to do this, and MongoDB's replication is only used to enhance the reliability of the data, and MongoDB uses sharding to achieve horizontal extensibility. (it is said that Couchdb also has plans to develop the sharding function.)
3. Data query Operations
This difference is in the user interface, MongoDB and the traditional database system similar to support dynamic query, even if there is no index on the line, can also make arbitrary queries. and CouchDB different, CouchDB does not support dynamic query, you must set up a corresponding view for each of your query mode, and query on the basis of this view.
4. atomicity
This is both consistent and supports atomic modification of rows (concurrent modifications of single documents), but does not support more complex transactional operations.
5. Data Reliability
CouchDB is a "crash-only" system where you can stop CouchDB at any time and keep your data consistent. MongoDB will need to run the RepairDatabase () command to repair the data file after an abnormal shutdown, and support a reliable –dur command after version 1.7.5.
6.map/reduce
MongoDB and CouchDB both support map/reduce, except that MongoDB is only used in data statistics operations, and CouchDB is used map/reduce when working with queries.
7. UseJavaScript
Both MongoDB and CouchDb support javascript,couchdb to create a view with JavaScript. MongoDB uses JSON as an expression for normal database operations. Of course you can also include JavaScript statements in the operation. MongoDB also supports the server-side JavaScript script (running arbitrary JavaScript functions server-side), and of course, the Map/reduce function of MongoDB is also JavaScript Format.
8.REST
CouchDB is a RESTFul database whose operation completely goes through the HTTP protocol, while MongoDB is walking its own binary protocol. MongoDB Server can open an HTTP interface for status monitoring at startup.
9. Performance
- Here is a list of the reasons for MongoDB's own high performance
- HTTP protocol with binary protocol rather than COUCHDB rest
- Using the Momary map memory map approach
- Collection-oriented, collection-oriented storage, the same collection data is continuously stored
- Update-in-place the mechanism of direct modification rather than the use of MVCC
- Write using C + +
10. Applicable scenarios
- If you are building a Lotus Notes-based application, we recommend the use of COUCHDB, mainly due to its MVCC mechanism. In addition, if we need a master-master architecture that requires geo-location-based data distribution, or if the data nodes may not be in line, we recommend using COUCHDB.
- If you need high-performance storage services, we recommend MongoDB, such as the user's personal information for storing large Web sites, such as the cache layer used to build on top of other tiers of storage.
- If you have a large number of update operations in your needs, then use MongoDB. As we did in the example updating real time analytics counters, for data stores that are constantly changing, such as the amount of traffic, the number of accesses, and so on.
MongoDB and couchdb in full contrast