Why You Should Always Be Running MongoDB Latest Version
Upgrades provide a number of important new features. You should always be running the latest version.
The latest major release, 6.0, supports multi-cloud cluster security through client-side field-level encryption. This protects data-in-transit, at-rest, and in memory.
Performance optimizations for time series collections, change streams, aggregations and queries. Bumping to 6.0 also provides better shard key support for the WiredTiger storage engine.
1. Queryable Encryption
Encryption has long been a cornerstone of data protection, protecting sensitive information while in-transit across networks, at-rest in storage and during processing. Queryable encryption allows data to remain encrypted even during query processing.
Queryable Encryption provides built-in encryption capabilities for sensitive application workflows such as searching employee records, processing financial transactions or analyzing medical records. This reduces operational risk for organizations and improves developer productivity by eliminating the need to implement various security protocols.
Queryable Encryption uses a fast, searchable encryption scheme that supports equality queries (range, prefix, suffix and substring searches to be added in future releases). It works with standard KMS services hosted by cloud providers or other KMIP-enabled key management providers.
2. Stable API
The stable API feature decouples your application from the database and provides you with a versioned set of commands that remain unchanged through major and rapid releases. This allows you to develop your application and test it, without worrying about whether future upgrades will impact the performance of your code.
The new unified command-line experience uses syntax highlighting, intelligent autocomplete, and context-sensitive help to provide a rich and usable interface. The new mongoshell also adds a customizable tabbed workspace and a more efficient way to access multiple shell variables.
The storage engine combines B-tree and WiredTiger to provide improved query performance, data compression, aggregation, and elasticity. It also introduces a number of enhancements including resumable upload and cluster-to-cluster synchronization.
3. Time Series Data
Time Series data can be extremely valuable for applications like IoT, financial analytics and other time-dependent scenarios. MongoDB 5.0 introduces native support for time-series data to make it easier, faster and cheaper to work with.
Time Serie collections automatically optimize the storage schema for ingestion, retrieval and storage through an underlying columnar format and clustered indexing. This significantly reduces I/O and storage footprints for queries.
This makes it possible to run ranged queries on time-series data 40 percent faster than with non-time-series. Furthermore, data densification and gap filling allow better handling of missing information in time-series data. Moreover, this feature eliminates the need for other specialized databases that require complex data movement and integration.
4. Clustered Indexing
A clustered index determines the physical order of DATA in a table. It acts as a secondary key for fast retrieval of data. A table can have only one clustered index. A nonclustered index provides pointers to the storage location of data.
The clustered indexing technique stores data pages on the disk in a defined order according to their value. It improves query performance.
It enables you to store and retrieve data from time series collections faster than before. It also makes the database more efficient for many OLTP scenarios and reduces hardware costs. It allows you to use the Change Stream feature with the clustered index and allows queries against the full collection.
5. Initial Sync
Initial synchronization is now more resilient to network failures that occur during the initial upload of oplogs. This feature enables you to resume uploads and maintain consistency without requiring a full sync from the primary node.
MongoDB 3.4 introduces a linearizable read concern level that guarantees that any successful write with a “majority” concern and acknowledged in the oplog returns data that is linearly consistent with the sequence of operations performed on the document. This read concern level is not supported for time series collections.
The new command-line shell provides a modern interface with syntax highlighting, intelligent auto-complete and contextual help for an improved user experience. It also includes a new interactive tutorial.
6. Partial Indexes
MongoDB supports a number of index types. Each type has a different set of features that affect its behavior.
For example, a unique index causes MongoDB to reject documents with duplicate values for the indexed key. Similarly, a sparse index stores only entries for documents that contain the indexed field but skips any document that does not have that field.
A TTL index is used for collections that expire data after a finite amount of time. Using TTL indexes decreases the size of the collection by discarding old records.