0

This is very basic question regarding mongodb.

Suppose, in my application, i have an entity "user". User has various data to store like its personal information, hobbies, education detail, professional detail, settings, contacts, photos etc.

I have a usecase where if i delete the user, everything related to it should also be deleted.

Considering the fact that mongodb is not completely atomic and supports single document integrity, would it be the good idea to use mongo db for above case if i dont keep all data in single document. Or to maintain the consistency, i would have to keep all the data in single document.

I have heard about some mongodb drivers which provide multiple collection transactions. Do they support multi server transactions as well?

Tanu Gupta
  • 602
  • 1
  • 11
  • 26
  • There are [2 phase commits](https://docs.mongodb.com/manual/tutorial/perform-two-phase-commits/), [mongodb 4 announce](https://www.mongodb.com/collateral/mongodb-multi-document-acid-transactions) and [transactionless architecture](https://martinfowler.com/bliki/Transactionless.html) to consider. The question itself is quite too broad though. – Alex Blex Feb 27 '18 at 16:05
  • From my experience, if you have to perform complex statements in a single transaction, `Mongodb` is just not the way to go because it introduces so much more control that you need to place in – forJ Feb 28 '18 at 00:41

0 Answers0