intermediateMongoDB Transactions — Single & Multi-Document ACID

Why should multi-document transactions be the exception rather than the default way of working in MongoDB?

They carry real overhead — they hold locks and resources across every operation until commit, and hold onto oplog entries longer than a normal write. The idiomatic MongoDB approach is modeling data so related things that must change together live in one document, atomic for free, reaching for a transaction only when that modeling genuinely isn't possible.

Ready to master this question?

Generate a complete walkthrough — background, the full answer in plain language, a working code example explained line by line, a real-world scenario, common mistakes, and how this same question gets asked in different ways.

Sign in to generate a response

Next Step

Continue to What should your application do when it receives a TransientTransactionError from MongoDB?← Back to all NoSQL questions