简体   繁体   中英

MongoDB. Transaction?

I wanted to know if there are ACID guarantees in multi-document transactions in MongoDB. What's the current status, existing materials are quite old. What's been upgraded now?

How can we simulate to show that it can't, if it can't OR can, if it can?

To make muti-document write process atomic You can use $isolated Operator

Using the $isolated operator, a write operation that affects multiple documents can prevent other processes from interleaving once the write operation modifies the first document. This ensures that no client sees the changes until the write operation completes or errors out.

You can perform Two Phase Commits for transaction-like semantics.

Check MongoDB 3.2 documentation for more details.

MongoDB will add support for multi-document transactions starting from version 4.0, so you will have ACID guarantees in multi-document transactions. For details visit this link:

https://www.mongodb.com/blog/post/multi-document-transactions-in-mongodb?jmp=community

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM