NoSQL data model (2) nosql document model

Source: Internet
Author: User
Tags couchdb

NoSQL data model (2) nosql document model
Background "document" is the main concept in the document database. Such databases can store and obtain documents in the XML, JSON, and BSON formats. These documents have subattributes and a tree-like data structure. They can contain ing tables, sets, and pure values. The documents in the database are similar to each other, but do not have to be identical. The document stored in the document database is equivalent to the "value" stored in the key-value database ". Document Database can be considered as a key-value database whose values can be queried. Popular document databases include MongoDB, CouchDB, Terrastore, OrientDB, and RavenDB.
Consistency To ensure "consistency" in the Mongodb database, you can configure a "Replica set" or specify that the write operation can be returned only after the abbreviated data is copied to all or a specified number of slave nodes. Each time data is written, you can specify the number of server nodes on which the written data must be propagated before the write operation returns. From the perspective of traditional relational databases, the term "transaction" means that we use insert, Update, delete, and other commands to operate different tables, then, use commit to submit the changes or roll back with the rollback command. NoSQL databases generally do not have these mechanisms: Their write operations are either successful or fail. A single-document-level transaction is called an atomic transaction ". Transactions of such databases generally cannot perform multiple operations. By default, all write operations are executed smoothly. You can use the WriteConcern parameter to fine tune this. The availability CAP theorem asserted that consistency, availability, and Partition Tolerance are only two. Document Database tries to use master-slave data replication technology to enhance "availability ". Multiple nodes have the same copy of data. Even if the master node fails, the client can still obtain the data. Application Code generally does not need to check whether the master node is available. Mongodb uses replica sets to achieve "replication" to provide high "availability ". Query functions different document databases provide different query functions. CouchDB allows you to query complex documents through view: You can use "Materialized View" or "Dynamic View" (equivalent to a view in a relational database, regardless of whether the view is materialized. If there are many query requests, do not perform extensibility every time you process the query request. Here, the term "extended" refers to the premise that the database is migrated to a larger computer, add or modify a node. We will not talk about how to make applications handle more loads. We are concerned about the functions of the database to improve the load processing capability. More "read slave nodes" are added to direct all read operations to the slave node, so that the database can be expanded to cope with frequent read operations. Applicable case event records (in enterprise-level solutions, events need to be recorded by many different applications. If the data types captured by the event keep changing, you should use the document database), content management system and blog platform (can be used to manage user reviews, user registration, user configuration, and Web-oriented documents .) Website analysis and real-time analysis (page views, number of independent visitors), and e-commerce applications. Not applicable to complex transactions that contain multiple operations (document databases are not suitable for cross-document atomic operations, and documents databases such as RavenDB actually support such operations) and query the ever-changing aggregate structure.




Related Article

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.