Refering to MongoDB's documentation,
About
Journaling, I see:
- Mongodb uses Write-ahead logging (Journaling) to guarantee durability of a write operation.
- Journaling is enabled by
default.
About
Write Concern I see:
- Write concern describes the guarantee that MongoDB provides
when reporting on the success of a write operation.
- Default write concern is "Acknowledged".
-
Acknowledged write concern does
not confirm that the write
operation has persisted to the disk system.
Now considering a use case, where I have Sharded MongoDB (with the default journaling/write-concern described above), with NO replica, and I am doing updates via Java Driver (from my client):
If by default, journaling is On, then Server only gets back to me, once the update logs are on disk, which means data is persistent. So how come Acknowledged mode does NOT guarantee the durability ?
Any explanation that helps me resolve the confusion would be great !