In a MongoDB replica set, w:1 returns an acknowledgment after the primary applies a write; w:"majority" waits until a calculated majority of data-bearing voting members acknowledge it. The trade-off is lower acknowledgment latency with w:1 versus stronger protection against rollback with majority write concern—assuming voting members have journaling enabled and the deployment uses the standard majority-journal setting.
What write concern controls
Write concern sets the acknowledgment threshold a write must meet before MongoDB reports success to the client. It does not determine what a later read will return: write concern is not read concern, and acknowledgment alone does not make every reader immediately see the newest value.
As an Amazon Associate I earn from qualifying purchases.
In a replica set, w:1 asks for acknowledgment from the primary only. w:"majority" asks for acknowledgment from a calculated majority of voting members that store data. The required count depends on the replica-set voting configuration; it is not necessarily every configured member or one fixed number. Arbiters do not store data and are not data-bearing members in this acknowledgment description. MongoDB’s replica-set write concern documentation explains these thresholds.
Free tools Windows power users keep installed
One-click scans. No signup required.
How the two settings compare
| Question | w:1 |
w:"majority" |
|---|---|---|
| What must acknowledge? | The primary. | A calculated majority of data-bearing voting members. |
| What happens if the primary fails before replication? | An acknowledged write may be rolled back if it had not reached a secondary. | The write has propagated to a majority; with journaling enabled on voting members, MongoDB documents this as the rollback-prevention approach. |
| What does acknowledgment wait for? | With numeric w:1 and j unspecified, acknowledgment follows application in memory; it does not wait for secondary acknowledgment. |
It waits for the majority threshold. With the standard majority-journal default, it also waits for on-disk journal persistence. |
| Latency direction | Does not wait for secondary acknowledgment. | Waiting for replication and journal work can add latency; the amount depends on the system. |
MongoDB’s documentation states: “A write concern of w: 1 only requires acknowledgment from the primary replica set member before returning write concern acknowledgment.” MongoDB Manual v8.0.
#1 Best Overall
When an acknowledged write can be rolled back
With w:1, the primary can acknowledge a write before any secondary has replicated it. If the primary then steps down or fails, a new primary may not have that write, and MongoDB may roll it back. This is a risk, not a certainty: a primary failure does not mean every recently acknowledged w:1 write is lost. MongoDB describes rollback behavior during failover in its write concern documentation and its replica-set rollback guidance.
MongoDB’s documented way to prevent rollback of acknowledged data is to run all voting members with journaling enabled and use { w: "majority" }. In MongoDB’s words, that combination ensures writes propagate to a majority before acknowledgment is returned. Majority therefore substantially reduces the risk of losing an acknowledged write in the documented failover case; it is not a promise against every conceivable failure or a replacement for backups and recovery planning.
Why journaling changes the durability claim
By default, writeConcernMajorityJournalDefault is true, so majority acknowledgment waits for journal persistence. If an administrator sets writeConcernMajorityJournalDefault: false, majority writes do not receive that same journal-persistence protection, and MongoDB says they can roll back after a transient loss of a majority of nodes. The setting and journaling configuration therefore matter when evaluating durability, not just the value of w.
Recommended Free Tools
For numeric w:1, j:true requests acknowledgment that the write has reached the journal. That is distinct from waiting for replication to other members. See MongoDB’s write concern reference for the interaction of w and j.
Rank #3
Does majority write concern add latency?
It can. A primary-only acknowledgment does not wait for a secondary, while a majority acknowledgment can wait for replication to the members needed to satisfy the threshold and for journal work under the standard default. A lagging or unavailable secondary can delay that acknowledgment and create performance issues in some configurations. MongoDB does not give a universal millisecond or percentage penalty: latency depends on topology, network, storage, write workload, and timeout settings.
Measure on the target deployment and workload rather than applying a generic estimate. Include normal operation and relevant degraded conditions, such as a lagging member, because the threshold may be slower to satisfy then. Streaming replication can reduce latency for writes that wait for replication, but it does not establish a topology-independent latency figure. MongoDB describes replication in its replica set data synchronization documentation.
Rank #4
What a timeout means—and how to handle it
If a write does not meet its requested acknowledgment threshold before the client receives a timeout or write-concern error, that response does not prove the operation was never applied. MongoDB says a write that misses the majority threshold before response may later replicate or roll back. Treat the outcome as uncertain until the application reconciles it; do not blindly retry a non-idempotent operation on the assumption that the first attempt did nothing.
- Use an idempotent operation or a stable application-level operation identifier where possible.
- When an operation is not safely repeatable, check the resulting state or reconcile through application-specific logic before retrying.
- Choose client and write-concern timeouts with the deployment’s failover and latency behavior in mind.
MongoDB’s write concern reference discusses timeout behavior at the write concern documentation.
Best Value
Check the effective default for your deployment
MongoDB Manual v8.0 says w:"majority" is the default for most replica-set configurations. MongoDB’s rollback guidance describes that default as applying to most deployments starting in MongoDB 5.0, and Atlas documents majority as its default. These qualifications matter: deployment configuration can affect the effective default, so check the setting and topology instead of assuming every cluster behaves identically. See the MongoDB Manual v8.0 replica-set write concern page, MongoDB’s rollback guidance, and Atlas rollback guidance.
Write concern does not control what a read sees
A majority write acknowledgment is not a guarantee that every subsequent read, from every node or with every read preference, returns the newest value. For causal consistency guarantees in a session, MongoDB calls for both majority write concern and majority read concern. The combination matters: write concern governs acknowledgment of writes, while read concern governs the guarantees attached to reads. See MongoDB’s causal consistency documentation.
Quick Recap
Which should you choose?
- Choose
w:"majority"when the application should not treat a write as successful until a majority has acknowledged it, and the deployment’s journaling configuration matches the durability assumptions. This is generally the safer choice when losing a recently acknowledged write would be unacceptable. - Choose
w:1only when primary-only acknowledgment is an intentional latency trade-off and the application can tolerate or recover from a recently acknowledged write being rolled back after failover. - Do not treat every higher numeric
was equivalent to majority. Numeric values greater than one specify a count and can include non-voting data-bearing members;w:"majority"is based on voting members. Their acknowledgment and durability semantics are not interchangeable. MongoDB details numeric write concern in its write concern reference.
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.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.




