Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →What do w:1, w:"majority", and j:true guarantee? They set different acknowledgment conditions: w specifies how many replica-set members must acknowledge a write, while j:true requires the members counted toward that condition to record it in their on-disk journals. Neither setting is an unconditional promise that a write will survive every failure. A timeout limits how long MongoDB waits for the requested acknowledgment; it does not undo a write already applied on the primary.
What each write concern confirms
MongoDB write concern is the condition a write must meet before MongoDB reports it as acknowledged. The controls answer related but separate questions: w sets the required acknowledgment count, j specifies a journal-persistence requirement, and wtimeout limits the wait for the w condition.
As an Amazon Associate I earn from qualifying purchases.
| Setting | What acknowledgment confirms | Important limit |
|---|---|---|
w:1 |
In a replica set, the primary has acknowledged the write. | It does not confirm replication to a secondary; the write may be rolled back if the primary steps down before another member replicates it. MongoDB Write Concern documentation and rollback documentation. |
w:"majority" |
A calculated majority of data-bearing voting members has acknowledged the write. Arbiters do not store data and are not counted as data-bearing members for this requirement. MongoDB replica-set write concern documentation. | Whether acknowledgment also waits for on-disk journal writes depends on writeConcernMajorityJournalDefault if j is not specified. MongoDB 7.0 Write Concern documentation. |
j:true |
The members required by the selected w value have written the operation to their on-disk journals. MongoDB Write Concern documentation. |
It does not independently require replication to additional members or prevent rollback after failover. |
wtimeout |
Limits how long MongoDB waits for the requested w acknowledgment condition. |
A write concern timeout does not undo a write that the primary already applied. MongoDB Write Concern documentation. |
What does w:1 mean, and can the write be rolled back?
w:1 asks for acknowledgment from one member: in a replica set, that is the primary. It is useful when an application accepts acknowledgment from the primary without waiting for replication, but the response does not establish that a secondary has received the write.
If the primary steps down or fails before another member replicates the operation, a new primary may not contain it and MongoDB may roll it back. MongoDB’s failover guidance recommends w:"majority" with journaling enabled on voting members for the documented rollback-avoidance case. That recommendation is not a claim that every correlated or otherwise exceptional failure becomes impossible. MongoDB: Rollbacks During Replica Set Failover.
#1 Best Overall
What does w:"majority" count?
w:"majority" waits for a calculated majority of data-bearing voting members, including the primary. The required count follows the replica set’s voting configuration; an arbiter can participate in elections but cannot store the write, so it is not a data-bearing acknowledgment for this requirement. MongoDB: Write Concern for Replica Sets.
Majority acknowledgment should not be described as a guarantee against every possible failure. Its persistence qualification matters: if j is omitted, the behavior depends on writeConcernMajorityJournalDefault. MongoDB 7.0 documentation says that setting defaults to true; when it is true, majority acknowledgment waits for on-disk journal writes. When false, acknowledgment need not wait for those writes, and MongoDB warns that a transient loss and restart of a majority of nodes can permit rollback. Check the setting and the server version rather than assuming majority always means journaled to disk. MongoDB 7.0 Write Concern documentation.
What j:true adds—and what it does not
j:true asks MongoDB to wait until the members required by the chosen w value have written the operation to their on-disk journals. MongoDB describes the behavior this way: “With j: true, MongoDB returns only after the requested number of members, including the primary, have written to the journal.” MongoDB Database Manual, Write Concern.
Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Clear out junk files and repair common Windows errors3Fix the driver behind crashes, sound loss and screen glitchesJournaling and replication are different conditions. A journaled write on the primary is not evidence that a secondary has replicated it: that requires a suitable w value. Conversely, w:"majority" with j unspecified follows the majority-journaling default described above; it is not equivalent in all configurations to explicitly requesting j:true.
Rank #3
What happens when a write concern times out?
If the primary applies a write but MongoDB cannot satisfy the requested acknowledgment condition before wtimeout expires, the operation can return a write concern error while the data modification remains in place on the primary. The timeout reports that the requested acknowledgment was not reached in time; it is not a cancellation or rollback mechanism. MongoDB Write Concern documentation.
Applications should therefore treat the result as acknowledgment uncertainty, not proof that the write did not happen. Blindly retrying a non-idempotent operation can cause duplicate effects; use an application-level retry strategy appropriate to the operation and verify state where needed.
Rank #4
Version and topology can change the practical result
Implicit defaults and arbiters
MongoDB’s implicit default write concern is generally w:"majority", but an arbiter-related topology can change it. If a replica set has arbiters and the number of data-bearing voting members does not exceed the voting majority, the implicit default is w:1. Inspect the deployment’s configured default and member roles instead of inferring them from the phrase “replica set.” MongoDB: Default Read Concerns and Write Concerns.
MongoDB 8.0 majority acknowledgment and secondary reads
Starting in MongoDB 8.0, a majority write can be acknowledged after a majority durably writes its oplog entry, while members apply the operation asynchronously. As a result, a read from a secondary immediately after the majority acknowledgment can occur before that secondary has applied the change. Majority acknowledgment alone therefore does not guarantee immediate visibility on every secondary. MongoDB: Write Concern.
Best Value
Atlas versus self-managed deployments
MongoDB documents w:"majority" as the default for Atlas clusters. That Atlas statement should not be generalized to every self-managed deployment, where the implicit default can depend on replica-set topology. MongoDB Atlas: Rollbacks During Failover.
Quick Recap
Choosing a write concern
- Choose
w:1when acknowledgment from the primary is sufficient for the application and it can tolerate the documented failover rollback risk. - Choose
w:"majority"when the write should be acknowledged by a majority of data-bearing voting members; verify the journaling default and topology for the deployment. - Add
j:truewhen the write must wait for journal persistence on the members counted byw; do not treat it as a substitute for replication. - Set
wtimeoutto bound acknowledgment waiting when appropriate, and handle its error as an uncertain outcome rather than assuming the operation was undone.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




