Do any WriteConcern configurations imply eventual consistency?

According to the mongodb documentation ( ) the default write concern for drivers is acknowledgement of write operations.

The default write concern on the new MongoClient class will be to acknowledge all write operations

Will the newly written document be immediately queryable even though the document might not have been written to disk?

In summary,

Do any of the write concern configurations in mongodb produce eventual consistency issues that developers need to be aware of that could cause a document just inserted/updated to not be immediately noticeable?

Write Concerns are acknowledgements back to the author to define the level of durability/certainty that the write(s) have taken place. Your question is fundamentally about Reads - and so you will want to review the Read Concerns features/options. But of course in general - not specific to Mongo - where there is replication if there are Reads occurring directly off the Secondaries then there definitely are intervals where it does not have the most fresh data. One must plan the Read strategy accordingly. For instance some analytics are fine off a secondary whereas some transactions must only read off the primary.

1 Like