Six Reasons to Embrace MongoDB 3.x Over MongoDB 2.x

Are you still deciding if you should upgrade to the next MongoDB version? This article is lists five reasons why we think you should switch from MongoDB 2.x to MongoDB 3.x.
MongoDB 3.x has been a welcome addition to the world of growing databases. The updated version contains many performance and stability improvements as compared to the last few versions. Statistics show that many developers continue to use MongoDB 2.x services in the production environment, despite concurrency issues continuing to arise from time to time. With the release of MongoDB 3.x, many of the performance and stability issues have been resolved, helping organizations leverage the true value of databases to build modern applications.
As promised, below are our five reasons why you should switch from MongoDB 2.x to 3.x:

1. Safer Database

MongoDB 3.x uses more secure algorithms keeping your business-critical data safer when compared to the previous versions. Below are the details:

The default value of the WriteConcern parameter in MongoDB 3.x is {w:1}, while in 2.x it is {w:0}.

MongoDB 3.x uses the more secure algorithm SCRAM-SHA-1 for authentication, in place of the default MONGODB-CR used in 2.x.

MongoDB 3.x supports encryption engines to encrypt stored data.

2. Higher Service Performance

The table below outlines the MongoDB version-wise details for MMAPv1 and WiredTiger from the performance perspective.

The performance problem while using MongoDB 2.x for high concurrency is mostly solved after upgrading MongoDB to MongoDB 3.x. MMAPv1 in 3.x provides a Set-Level lock, which enhances concurrency.
In fact, for enhanced concurrency, MongoDB 3.x also supports WiredTiger, with Document-level lock. This locking technique ensures that only a particular document gets locked during active operations while allowing other users to access the rest of the documents present in the same database.

3. Lower Storage Costs

The table below outlines the MongoDB version-wise details for MMAPv1 and WiredTiger from the storage

Many users may be surprised to find a much smaller utilized data size after upgrading from MongoDB 2.x to MongoDB 3.x with WiredTiger. For example, 100G of data shrink to 30G after the update. Data shrinkage occurs because WiredTiger adopts Snappy compression by default, which cuts down the storage cost by 70–90 percent when compared to MMAPv1.

4. Faster Replication

MongoDB 3.x achieves fully streamlined OpLog pulling and playback with a higher efficiency while synchronizing incremental data.

5. Improvements in Full Data Synchronization

All indexes are created during data copying (only the _id index is created at data synchronization in previous versions).
The secondary node continues to pull a new OpLog while copying data, which leads to higher synchronization efficiency, avoiding synchronization failure due to the OpLog.

6. Simpler and More Efficient Sharding Cluster

From MongoDB 3.2, the config server of the sharding cluster is also a replica set, facilitating the maintenance, while there are multiple independent MongoDB nodes in previous versions.
From MongoDB 3.4, the config server will take on the migration of sharded clusters. Also, migration tasks can be initiated at the same time, with higher migration efficiency.

  • MongoDB 3.x also incorporates other useful features, such as:
  • Partial index, which can reduce the index space
  • Document validation in flexible document models
  • Collation, supporting sorting by localization languages
  • Read-only views to easily write complicated queries
  • More robust support for aggregation

Recommended Steps to Upgrade

MongoDB 3.x has come up with new enhancements when compared to MongoDB 2.x. It is recommended to upgrade to MongoDB 3.0 before upgrading to other higher versions using this guide.
Please note that MongoDB can be upgraded from 2.x to 3.x without stopping or interrupting running services.
Follow the steps below to upgrade from 2.x to 3.x safely:

  • Create a new 3.x replica set
  • Use mongodump in 2.x to backup data from the set
  • Wait for the 3.x service to stabilize and remove the 2.x replica set

Upgrade Suggestions for Other Versions

For other versions, we recommend the following upgrades:
For 2.x and 3.0 versions, we strongly recommend upgrading to version 3.2.
For 3.2 and 3.4 versions, we recommend continue using the same version.


This article covers why MongoDB 3.x is a better choice over previous versions. It also puts some light on the recommended upgradation steps and suggestions.





Follow me to keep abreast with the latest technology news, industry insights, and developer trends. Alibaba Cloud website:

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Oracle WebLogic Remote/Outbound URL Monitoring

Data Conversion Practices of MaxCompute Data Warehouse

How Does CD Finance Deal With the High Disaster Recovery Pressure in the Financial Industry?

How to Install and Secure Mosquitto MQTT Messaging Broker on Ubuntu 16.04

Collaborative Extension: Part 1-Prepare and Expose Back-end APIs

SQL Server Best Practices: Using Filegroups to Implement Cold and Hot Data Isolation Backup…

Creating Scalable Search Service for Online Resources

Disaster Recovery: Why Go Hybrid in the Cloud?

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Alibaba Cloud

Alibaba Cloud

Follow me to keep abreast with the latest technology news, industry insights, and developer trends. Alibaba Cloud website:

More from Medium

Confluent Kafka Multi-Region Cluster in 2 minutes

Kafka: A general understanding

Kafka Dynamic Configuration & Multiple Error Handler

Packaging your work in a box to ship safely anywhere aka Containers