What did MongoDB not being ACID compliant before v4 really mean?

前端 未结 10 1142
情书的邮戳
情书的邮戳 2020-12-04 04:15

I am not a database expert and have no formal computer science background, so bear with me. I want to know the kinds of real world negative things that can happen

10条回答
  •  悲哀的现实
    2020-12-04 05:12

    "In MongoDB, an operation on a single document is atomic" - That's the thing for past

    In the new version of MongoDB 4.0 you CAN :

    However, for situations that require atomicity for updates to multiple documents or consistency between reads to multiple documents, MongoDB provides the ability to perform multi-document transactions against replica sets. Multi-document transactions can be used across multiple operations, collections, databases, and documents. Multi-document transactions provide an “all-or-nothing” proposition. When a transaction commits, all data changes made in the transaction are saved. If any operation in the transaction fails, the transaction aborts and all data changes made in the transaction are discarded without ever becoming visible. Until a transaction commits, no write operations in the transaction are visible outside the transaction.

    Though there are few limitations for How and What operations can be performed.

    Check the Mongo Doc. https://docs.mongodb.com/master/core/transactions/

提交回复
热议问题