Couchdb without nosql

Source: Internet
Author: User
Tags couchdb
Couchdb, as part of the nosql trend, is easy to compare with the database labeled with buzzwords. Key-value stores, tuple stores, bigtable clones, document store, graph database, and other labels are attached to each category.

These classification labels sometimes help programmers outline the technical properties of the latter segment, but in many cases, the programmer's preference may be wrong and biased. We can say that these new technologies all want to solve the CAP Theorem Problem, but these different database plans have their own problems and development philosophy, if general features are used as the method for selecting technology, it is often found that the development direction of the special program is not necessarily suitable for your own needs. Programmers should first define their own problems and then select the technology that best suits the attributes.

Mikeal Rogers, couchone's developer, once said that the recent wave of industry masks the problems actually to be solved by the experts and replaces them with the imagination and expectation of big data. Mikeal allows others (with old database vendors) to pursue the nosql wave. couchdb can focus on mobile database processing.

Couchdb features

I tried couchdb for a while and enjoyed several special features. The introduction is as follows:

* Implemention for ACID properties
** Multi-version concurrency control (MVCC)
** B-tree indexes
* Schema-free document-oriented database
* Restful JSON API
* View model/JavaScript view Functions
* Replication (peer-based distributed databases), distributed, featuring robust, incremental replication with bi-directional conflict detection and management.

Couchdb uses the MVCC model. All Database writes (ADD, update, delete) do not need to lock the database first, so that the data can be read in real time. Indexes rely on B-tree to store a large number of hard disks. document creates an index and uses each view designed by mapreduce pattern to access an index, therefore, your database will use a large amount of hard disk space in exchange for speed.

Couchapp is easy to use with the browser and supports permission functions. Because the information can be JSON document at will, you can store everything you like. In addition, the API interface is restful. With the built-in JavaScript view server, you can use the built-in show function to render document.

The most important feature is the replication feature. Couchdb supports two-way conflict detection, which facilitates the quick synchronization of database content after a long-term offline client goes online. You can also access pulled data offline.

Current couchdb restrictions

Although couchdb uses the MVCC model, the read and write speed of couchdb is much slower than in-memory key-value, and the evaluation with MySQL is not successful. In addition, couchdb only supports replication and requires horizontal partitioning to rely on couchdb lounge. It is equivalent to manual sharding, and it cannot beat other database systems in terms of efficiency and elasticity.

In addition, to access unstructured data, if you want to query special data, you must rely on the view model. Each view group will create an independent B-tree index, which is costly, especially when you want to perform ad hoc query, using _ temp_view will waste a lot of computing resources on disk and CPU. Therefore, you must create a view before designing the software and inputting data.

Although view functions uses mapreduce pattern, it is difficult to process data multiple times due to couchdb view API restrictions. Basically, the data from the last view is limited to only one query. You cannot perform the second mapreduce processing conveniently. The lack of flexibility makes mapreduce seem like a limitation, not a characteristic.

Applications except Big Data

Except for the preceding restrictions, couchdb features many applications, especially the json api and peer-based distributed functions. This allows couchdb to easily provide some applications on laptop or mobile devices, especially when you often need to process server and local data on offline devices.

In addition to couchone mobile for Android, couchone is compatible with couchdb. In Linux, desktop couch is available. Currently, it integrates tomboy, evolution, bindwood for Firefox, and other functions to manage Pim and bookmarks. Theoretically, it can be integrated with ubuntuone or Midgard.

I have read two books about couchdb, couchdb: the definitive guide and beginning couchdb. I personally recommend "beginning couchdb", but the content of "couchdb: the definitive guide" has been improved.

◎ The author introduced Rex Tsai or the network name chihchun. He is a freelancer and is engaged in open source software consulting or development services. He proposed and promoted free software and open source code. Early kalug members often attended tossug and hackingthursday meetings and prepared volunteers for the annual meeting of Open Source talents (coscup. Long-term Debian and openwrt users. For more information, see http://people.debian.org.tw /~ Chihchun/

// --------------- It's my post reading experience

In China, couchdb is very cold compared with MongoDB. The reason for the cold is as mentioned in the above article, the speed of reading and writing in exchange for space is not as high as that of MySQL. The distributed architecture must be manual, and the API can only be queried once, but cannot be filtered twice. These aspects are fatal for data.

It has shortcomings and features. The feature is that the data is stored in JSON format and a new version is generated after the update, which makes couchdb a good offline database.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.