Latest development in branch 4.9
4.9.0-rc1
Released 03 May 2021
(5 years ago)
SoftwareMongoDB Server
Version4.9
Status
End of life
Latest release4.9.0-rc1
03 May 2021
(5 years ago)
End of lifeUnavailable
Downloadhttps://www.mongodb.com/try/download/community
MongoDB Server 4.9 ReleasesView full list

What Is New in MongoDB 4.9

MongoDB 4.9 is a rapid release focused on refining existing features and enhancing the developer experience. It introduces significant improvements to time series collections, sharding, and the aggregation framework.

Category Key Changes
New Features Time Series Gap Filling, Sharded Time Series Collections Preview
Improvements Aggregation $dateAdd/$dateSubtract operators, Refined Sharding Operations
Platform Support Added support for Ubuntu 22.04 and RHEL9

How does MongoDB 4.9 improve time series data handling?

The biggest upgrade is the preview of sharded time series collections. This lets you horizontally scale your time series data across a cluster, which is crucial for handling massive IoT or financial datasets that outgrow a single server.

For data analysis, the new $gapFill stage is a game-changer. It automatically inserts null values for missing time intervals in your data, making it much easier to run continuous calculations without manual data cleanup.

What aggregation pipeline enhancements were added?

MongoDB 4.9 adds more power to date manipulation within aggregations. The new $dateAdd and $dateSubtract operators provide a more intuitive way to perform arithmetic on dates compared to the older $add and $subtract methods.

In practice, this means your aggregation queries for time-based calculations become cleaner and less error-prone. You can now easily add 5 days or subtract 3 hours from a date field directly.

Were there any changes to sharding operations?

Yes, the process of refining shard keys got smoother. The refineCollectionShardKey command now has improved performance and reliability when you need to add new fields to an existing shard key.

This matters because it reduces the operational headache when your data distribution needs change. You can adapt your sharding strategy without resorting to complex manual data migration.

FAQ

Is the sharded time series collections feature production-ready?
No, it's currently labeled as a preview feature in 4.9. This means it's available for testing and development but isn't recommended for production workloads yet. You should use it to start designing and prototyping your scaled time series applications.

How does the $gapFill stage work with existing data?
The $gapFill stage works on any time series collection. You specify the time field and the bucket size, and it will generate placeholder documents for any missing time intervals within your selected range, which you can then process with other pipeline stages.

Can I use $dateAdd with timezone conversions?
Absolutely. The $dateAdd and $dateSubtract operators fully support timezone-aware calculations. You can specify the timezone as a parameter to ensure your date arithmetic accounts for daylight saving time and regional differences.

What happens if I try to refine a shard key on a heavily used collection?
The improved process in 4.9 is designed to be less disruptive, but it's still a metadata operation that requires care. It's always best to perform such operations during periods of lower database traffic to minimize potential performance impact.

Does upgrading to 4.9 require any special steps for existing time series collections?
No, your existing time series collections will continue to work without any changes. The new features like gap filling are additive and accessed through new aggregation stages, so your current data and queries remain compatible.

Releases In Branch 4.9

VersionRelease date
4.9.0-rc103 May 2021
(5 years ago)
4.9.0-rc023 Mar 2021
(5 years ago)
4.9.0-alpha710 Mar 2021
(5 years ago)
4.9.0-alpha605 Mar 2021
(5 years ago)
4.9.0-alpha524 Feb 2021
(5 years ago)
4.9.0-alpha427 Jan 2021
(5 years ago)
4.9.0-alpha326 Jan 2021
(5 years ago)
4.9.0-alpha221 Jan 2021
(5 years ago)
4.9.0-alpha119 Jan 2021
(5 years ago)
4.9.0-alpha016 Jan 2021
(5 years ago)
4.9.0-alpha08 Oct 2020
(5 years ago)