Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Does MongoDB release version 4.0 support ACID transactions?

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

It is believed that many inexperienced people are at a loss as to whether MongoDB version 4.0 supports ACID transactions. Therefore, this paper summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.

MongoDB recently released the latest version 4.0.

There is no doubt that the main feature of this release is support for multi-document ACID transactions. MongoDB has taken a big step towards integration with relational database products, now supports the concept of session, and can use start_transaction () and commit_transaction () methods to include multiple database commands in a single MongoDB transaction.

MongoDB's transactions follow the famous ACID model. Atomicity ensures that commands belonging to the same transaction are either executed or not executed, and there is never any remaining or partial data. Consistency means that the database always maintains a transition from one valid state to another and will never be in an invalid state. Isolation ensures that multiple transactions can be executed at the same time, and none of them can view some of the results of other transactions. Executing multiple transactions at the same time has the same end result as sequential execution. Persistence ensures that committed transactions will remain persistent even if the system fails.

MongoDB's multi-document transactions apply only to servers that use the WiredTiger storage engine, and currently support only a single replica set. Version 4.2 will bring sharding cluster support.

Multi-document transactions have some limitations, such as the inability to affect database catalogs (that is, listing indexes and collections) and the inability to execute commands that are not within the scope of CRUD and information lists.

These transactions can only use readPreference and readConcern,local or majority. The readPreference within the transaction overrides the readPreference set at the collection, database, and client levels.

Query cursors are isolated in a transaction, which means that getMore operations in a transaction can only be used internally, and then outside the transaction can only be used outside the transaction. MongoDB provides a large number of commands to support transactional operations.

MongoDB Stitch is a serverless platform provided by MongoDB for the rapid development of client applications that can securely access MongoDB services. MongoDB Stitch provides serverless functionality through the JavaScript function, as well as QueryAnywhere, which allows client code to safely query the MongoDB server from Web or mobile applications. When the database changes, the trigger will take some actions, similar to RDBMS's trigger. The upcoming Mobile Sync will allow automatic data synchronization between MongoDB servers and mobile clients (MongoDB mobile that has been released in beta).

MongoDB version 4.0 introduces type conversions between double, string, objectId, boolean, date, integer, long, and decimal types. This enhances data conversion within the database and reduces dependence on ETL processes.

The beta also includes MongoDB Enterprise Kubernetes Operator, which is used to deploy MongoDB in a Kubernetes cluster while leveraging the capabilities of MongoDB Ops Manager. Developers can download the latest version or try out the online services provided by MongoDB Atlas.

After reading the above, do you know whether MongoDB version 4.0 supports ACID transactions? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report