Understanding Atomic Write Operations

Write operations are atomic, only one write at a time, at the document level in MongoDB. This means that only one process can be updating a single document or a single collection at a time. Therefore, writing to documents that are denormalized is atomic. However, writing to documents that are normalized requires separated write operations to subobjects in other collections, and therefore the writes of the normalized object may not be atomic as a whole.

You need to keep atomic writes in mind when designing your documents and collections to ensure that your design fits the needs of the application. In other words, if you absolutely must write all parts of an object as a whole in an atomic manner, then you need to design the object in a denormalized fashion.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.0.97