I have Java processes to update MongoDB 3.6.0. I have 1 - primary, 2 replicas. The flow is
Update some data in a document having a specific "_id"
Read from replicas
Sometimes, read gets an older version of the document.We decided to use WriteConcern to address this -
WriteConcern(WriteConcern.W3.withWTimeout(100, TimeUnit.MILLISECONDS).withJournal(false));
With the introduction of WriteConcern there will be some latency and to avoid too much latencies i skipped updating the Journal log
Is the above config going to work ?
This is a high level view of the writing process:
If you set up writeConcern = 3, and one server goes down, the user will never get an acknowledgment.
Also, disabling journaling won't fasten replication. I recommend to use writeConcern majority, and keep journal. But if you prefer to disable journaling, then the only problem would be data written between that 1s in 3.