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

前端 未结 10 1138
情书的邮戳
情书的邮戳 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 04:56

    It's actually not correct that MongoDB is not ACID-compliant. On the contrary, MongoDB is ACID-compilant at the document level.

    Any update to a single document is

    • Atomic: it either fully completes or it does not
    • Consistent: no reader will see a "partially applied" update
    • Isolated: again, no reader will see a "dirty" read
    • Durable: (with the appropriate write concern)

    What MongoDB doesn't have is transactions -- that is, multiple-document updates that can be rolled back and are ACID-compliant.

    Note that you can build transactions on top of the ACID-compliant updates to a single document, by using two-phase commit.

提交回复
热议问题