4 ms·
Writes in MongoDB are persisted before the server returns acknowledgement. For a typical replica set deployment, this additionally means replicated and made dur
by dgottlieb 3y ago
Writes in MongoDB are persisted before the server returns acknowledgement. For a typical replica set deployment, this additionally means replicated and made durable on disk for a majority of nodes.
MongoDB has tunable durability guarantees; clients can opt-out of this behavior.
The layers are deep, but this is the function that handles waiting before acknowledgement:
https://github.com/mongodb/mongo/blob/20f42d9dc89999d119f35ab3261a0d3ae6e85087/src/mongo/db/write_concern.cpp#L276-L279 https://github.com/mongodb/mongo/blob/20f42d9dc89999d119f35a...