intermediate~3h
MongoDB Transactions — Single & Multi-Document ACID
Every single-document write in MongoDB was always atomic; multi-document transactions extend that same ACID guarantee across documents and collections, for the cases where embedding related data together genuinely isn't an option.
Learning objectives
- Explain why a single-document write never needed a transaction to be atomic.
- Describe what a multi-document transaction guarantees, and the overhead it costs to get that guarantee.
- Handle a TransientTransactionError correctly, and explain why MongoDB's drivers surface it as retryable.
This is a Pro chapter
Sign in, then upgrade to Pro or Power to unlock this and the full Databases Mastery library.
MongoDB Transactions — Single & Multi-Document ACID