- Faster primary-secondary synchronization
All indexes are created when data is synchronized (only the _id index is created in
earlier versions). During data synchronization, the secondary node continuously reads
new oplog information to ensure that the local database of the secondary node has
enough space to store temporary data.
- More efficient load balancing
In earlier versions, Mongos nodes are responsible for load balancing of sharded cluster
instances. Multiple Mongos nodes contest a distributed lock. The node that obtains
the lock performs load balancing tasks and migrates chunks between shard nodes. In
MongoDB 3.4, the primary Configserver node is responsible for load balancing. This
greatly improves the concurrency and efficiency of load balancing.
- More aggregation operations
Many aggregation operators are added in MongoDB 3.4 to provide more powerful data
analysis capabilities. For example,
bucket can conveniently classify data.
$grahpLookup supports more complex relational operations than
$lookup in MongoDB 3.2.
$addFields enables richer document operations such as summing some fields and saving them as
a new field.
- Sharding zones supported
The zone concept is introduced for sharded cluster instances to replace the current
tag-aware sharding mechanism. It can allocate data to one or more specified shard
nodes. This feature allows you to conveniently deploy sharded cluster instances across
- Collation supported
In earlier versions, strings stored in documents are always compared byte by byte
regardless of Chinese, English, uppercase, or lowercase. After collation is introduced,
the string content can be interpreted or compared based on the used locale. Case-insensitive
comparison is also supported.
- Read-only views
MongoDB 3.4 supports read-only views. It virtualizes the data that meets a certain
query condition into a special collection, on which you can perform further queries.
- Cross-document transactions
As the first NoSQL database that supports cross-document transactions, MongoDB 4.0
combines the speed, flexibility, features, and ACID guarantee of document models.
- Migration speed increase by 40%
Concurrent read and write operations enable new shard nodes to migrate data fast and
bear service load.
- Read performance significantly improved
With the transaction feature, secondary nodes no longer block read requests due to
log synchronization. The multi-node scaling feature is supported in all versions to
significantly improve reading capabilities.
- Distributed transactions
The two-phase commit method helps the ACID feature of sharded cluster transactions,
expands business scenarios, and achieves a leap from NoSQL to NewSQL.
- Repeatable reads
The repeatable read feature provides the automatic retry capability in a poor-quality
network environment. This reduces logic complexity at the service side and ensures
continuity of your business.
- Wildcard indexes
You can create a wildcard index for nondeterministic fields to overwrite multiple
feature fields in a document for flexible management and usage.
- Field-level encryption
Field-level encryption is supported at the driver layer and can be used to separately
encrypt specified sensitive information such as accounts, passwords, prices, and mobile
phone numbers. You can use Field-level encryption to improve business flexibility
and security without full-database encryption.
- Materialized views
Latest materialized views can cache computing results to avoid repeated computing
for improved operational efficiency and reduce logical complexity.