I try to uderstand how journaling is exactly working : is that correct ?
When no journaling is activated on the server side (mongod --nojournal) :
When journaling is activated on Mongod (mongod --journal (default on 64 bits version):
I actually did not find anything in the official documentation about case 2(b), could someone confirm if journal is used when j is false on the client side but journaling is activated on the mongod ?
Your assertions are all correct. I think the language you are using is confusing and may be confusing you a little bit, however. Clients don't request writes that are journaled or non-journaled. If journaling is on, writes will be journaled, regardless of what the client does. What the client includes is a write concern that requires a certain level of data replication (the w
parameter) and/or journaling (the j
parameter) before the server responds that the write is a success. What you mean by a non-journaled write is j = 0
, which means the server will respond with success without waiting for the write to be committed to the journal; j = 1
means the server will not respond to the write until it has been committed to the journal.
The w
parameter controls the level of replication of the data necessary for a successful response. There's more detail in the link above.