Should I use Timeseries or another way to sort massive amounts of data

Im creating a program that is fetching data from an API to display that data in an easy to read format but I also want to save that data for later use.

The API gives me a random set of numbers and a few other True/False fields plus a timestamp. I was looking into using timeseries to sort the data, but after reading about it I found some forum posts that said timeseries sort could be quite slow for very large amounts of documents. (For reference the API gives out data every 2-2.5 minutes and goes back a few years, so it would be roughly 1 million documents (But I will definitely not end up with that many)) What would be a way to sort loads of data by its timestamp quickly.

[I am new to the forums so apologies if this is in the wrong place]

Hey @Catotron_N_A,

Welcome to the MongoDB Community!

May I ask how big are the documents on average, and what it looks like? Could you share a sample of it?

When inserting data into a time series collection in MongoDB, the order of the document timestamps impacts performance and query efficiency.

Inserting in random timestamp order can cause many more buckets to be created than necessary. This is because one of the time series collection’s assumptions is that you’ll be inserting your data in a regular interval in a monotonically increasing time order.

To read more about the bucketing pattern, please refer to this post.

Based on my understanding you can consider:

In case you need further help, feel free to reach out to us.