As you may have noticed, Studio 3T’s latest release, 2022.9, added support for Time Series Collections in MongoDB. MongoDB has always had the ability to store time series data, that is information which is associated with a series of times like sensor readings or stock market prices.
Because of the way MongoDB works though, this would often be inefficient when it came to storage and retrieval. Users and developers would come up with their own workarounds to these issues, but there had to be a better way.
The Arrival of Native Time Series
That’s why, when MongoDB 5.0 was released, MongoDB added “native” Time Series Collections. These make storing time series data much more efficient. There’s a whole lot of restructuring of data that goes on behind the scenes with “native” time series collections. But it does mean that you get to store more data. And in a way that can be consumed faster by aggregation.
To make this work though, you have to tell MongoDB some details about your fields and what they mean. That’s where Studio 3T’s support comes in, asking for those fields when you want to make a “native” Time Series collection. Studio 3T’s collection management is also time series aware. It will, where needed, do the right thing when presented with a Time Series collection.
Time Series and Aggregation
One of the most important features of Time Series collections was the addition of $setWindowFields. This lets you exploit the data in a time series by giving you the ability to aggregate data over a moving window on that data. Rolling averages and other calculations which used to be very complex, or near impossible to do inside the database, become simple. You can read more about this in What is $setWindowFields and why is it so neat?
Time Series Challenges
If you read our article MongoDB Time Series Collections Explained, you’ll understand that these special collections do have some very specific limitations. For example, they will often behave more like a view because that is what you access when querying them. But if you can work with those limitations, your ability to process Time Series data is greatly enhanced. If your data leads with a timestamp, check out Time Series collections today. And let Studio 3T help you create and query them.