MongoDB 7 Release Date
The MongoDB 7.0 major release introduced Queryable Encryption, the industry’s first database technology that delivers expressive queries on encrypted data in-use. The 7.0 major release also included an improved AutoMerger feature and new options to control its behavior.
The 7.0 major release removed the operationsBlockedByRefresh document that contained statistics about transactions blocked by catalog cache refresh activity. It added the analyzeShardKey command and db.collection.configureQueryAnalyzer() method to enable query sampling and provide metrics for evaluating shard key effectiveness.
1. Queryable Encryption
Protect sensitive data across the database with Queryable Encryption, which safeguards data in-transit and at-rest, in memory, in logs, and on backups. It’s easy to enable, requires no changes to application code and can be accessed via popular MongoDB drivers.
This technology substantially minimizes institutional risk and enables customers to meet stringent regulatory and security requirements such as HIPAA, GDPR, CCPA, and PCI by ensuring that in-use data is encrypted while retaining full query functionality.
Queryable Encryption supports rich queries such as equality (available now in preview) and range, prefix, suffix, substring searches on fully randomized encrypted data. This feature significantly reduces the potential impact of compromised security configurations and allows developers to remain focused on building their applications.
2. Time Series Data
Time Series Databases (TSDBs) handle data points that are measured in a specific interval of time, such as stock market data, smart meter readings or financial transaction information. TSDBs require high read and write performance with advanced query capabilities.
Using MongoDB, you can create a time series collection that has a timestamp field and an optional metaField and granularity that specifies the interval of measurement, such as seconds, minutes or hours. These collections are append only and immutable with a very limited variance from one point to another. You can also use aggregation pipelines on these data points. MongoDB 7.0 improves the experience with Time Series data by optimizing storage, enabling compression and providing faster querying. This includes support for compound wildcard indexes. This feature is supported in the latest version of MongoDB 7.0.
3. Aggregation Pipelines
A database query starts simple but as the database scales and the data grows more complex logic becomes necessary. MongoDB’s aggregation framework allows developers to break down these more confounding queries into sequential operations by using a series of aggregation pipeline stages.
Each pipeline stage in the aggregation chain can transform documents as they move through it. Some, like $match and $group, filter documents while others, such as accumulators and function aggregation operators, maintain state.
The optimizer performs pipeline optimizations which reshape aggregation pipeline operations for better performance. For more information, see Optimize Aggregation Pipelines with Indexes and Document Filters. Using the aggregate() method in MongoDB Shell, you can build an example aggregation pipeline. You can then execute the pipeline in Atlas to retrieve a resulting set of documents from a collection.
4. Compound Wildcard Indexes
For applications that frequently query multiple subfields of embedded documents whose values are uncertain or liable to change due to evolving use cases, a compound wildcard index is an excellent option. Such an index will be more effective than a single wildcard index that covers all of the field’s value.
A compound wildcard index omits the _id field by default. However, you can include the _id field by explicitly specifying it in the index definition using wildcardProjection. This feature can help reduce storage usage and query execution time. It also simplifies application design and prevents running into the 64 index collection limit of MongoDB. This feature is only available with fCV version 7.0 and later. For more information on how to create compound wildcard indexes, refer to the MongoDB documentation.
5. Change Streams
Change streams let applications subscribe to real-time data changes for a single collection, database or deployment. Unlike tailing the oplog, which is difficult to manage and requires the application to continuously poll data, change streams enable an application to receive notifications of data changes as they occur.
Developers can read events in a change stream using an event emitter or iterator. They can also use aggregation pipelines to filter and transform change events.
A key feature of change streams is resumability, which means that applications can restart at a given point in the stream of events. For example, if a document in the oplog has a large field, you can split that document with a $changeStreamSplitLargeEvent and then begin resuming from that fragment. This allows you to work with high cardinality time series data without losing important information.