Update a document based on other documents in atomically

The reason transactions exist as a design pattern since the 1960’s or 1970’s is that figuring out all the ways a sequence of database operations can unexpectedly become non-atomic requires knowledge of (often undocumented) internals. If your question is, “How to I guarantee that this compound operation will be atomic?” then the answer is, “make it a transaction.”

4 Likes