Hi,
We’ve been working with MongoDB for more than a decade and we are now considering the use of MongoDB Time Series. We do have time-series data: every document has its corresponding timestamp, there is a new record inserted every minute, and there is no need to modify data already inserted.
However, the data we are planning to save associated to each timestamp is somewhat complex and actually already pre-processed.
Our use case is related to finance, but below you can find a simplified document illustrating a similar example with cars and motorbikes in a parking lot.
{
timestamp: ISODate("2024-04-23T00:00:00.000Z"),
metadata: {
parking_id: 'XXX',
parking_type: 'INDOOR|OUTDOOR'
},
active_parkings: 4023,
cars:{
total_cars: 4444
variation: 25
number_cars_suv: 421
number_cars_sportive: 321
variation_number_cars_suv: 33
},
motorbikes:{
total:422
scooters: 215
}
}
Our application is already calculating the totals accumulated and the variations between consecutive timestamps before inserting the documents. When the data is read, there is no processing to be done over the data; it just needs to read about 200-500 documents (consecutive timestamps).
The question is: Is TimeSeries a good fit for this use case, or would “normal” MongoDB collections work the same well?
Thanks!