MongoDB 4.0 is expected to support cross-document transactions

Source: Internet
Author: User
Tags install mongodb mongodb query

MongoDB 4.0 is expected to support cross-document transactions

Since MongoDB acquired WiredTiger and its relational database storage engine, many technical experts have been waiting for MongoDB to provide support for multi-document transaction. MongoDB announced this week that it is expected to join MongoDB 4.0 in cross-document transactions this summer.

According to MongoDB's Grigori Melnik, "80% to 90% of applications do not require cross-document transactions at all ". However, his statement remains to be discussed. There may be a large amount of denormalized data in hierarchical databases. Such data must be updated in multiple places at the same time to ensure consistency. Melnik continued:

In addition, some developers and database administrators are limited by relational data modeling that has existed for more than 40 years, and they always mistakenly believe that multi-table or multi-document transactions are the requirements of all databases, no matter what data model is actually required. Others worry that, although their applications currently do not require cross-document transactions, they may do so in the future, and they do not want to overscale their databases.

Cross-document transactions are the cornerstone of ACID. MongoDB starts to support cross-document transactions since version 3.0. In version 3.0, MongoDB provides multi-version concurrency control (MVCC) technology, which is a snapshot isolation technology, usually provided by PostgreSQL, Oracle, and other relational databases. The latest version of SQL Server also uses MVCC to implement its "memory optimization" table.

MongoDB 3.2 supports Read Concern. Before version 3.2, the customer receives data only when they know the nodes for communication. The read focus function allows customers to request data that is known to most nodes. It should be noted that, according to the document, "the latest data on the node may not reflect the latest version of data in the system regardless of the read concern level ."

MongoDB later provided the declared "causal consistency" in version 3.6 ". In previous MongoDB versions, operations were performed in the specified order. For example, if you delete a group of records and perform another read operation, the deleted records may be returned. With causal consistency, you can specify that the read operation depends on the result of the write operation and ensure that the delete operation is completed before the read operation is executed.

Last, MongoDB 4.0 provides consistent read performance. That is to say, MongoDB only returns data that is known at the beginning of the read operation. As described in InfoQ's article [Quick Start to transaction isolation levels and dirty reads] http://www.infoq.com/cn/articles/Isolation-Levels), The results returned by previous MongoDB versions may be different from any point in time. It may even skip some documents or return multiple versions of the same document in one query.

Developers who want to try cross-document transactions can actively join the MongoDB 4.0 beta program.

For more MongoDB tutorials, see the following:

Introduction to MongoDB documents, collections, and databases

MongoDB 3 shard deployment and Fault Simulation

Install MongoDB in CentOS 6.5 yum

Quick installation of MongoDB using CentOS 7 yum

MongoDB query operations

Quickly build MongoDB clusters on Azure virtual machines

Principles of MongoDB replica set

MongoDB 3.4 remote connection authentication failed

Install MongoDB3.4 database system in Ubuntu 16.04

MongoDB authoritative guide 2nd PDF complete with bookmarks directory download see

MongoDB details: click here
MongoDB: click here

MongoDB 4.0 to Include Multi-Document Transactions

This article permanently updates link: https://www.bkjia.com/Linux/2018-02/151059.htm


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.