MongoDB (from version 5.0) provides a collection type, time-series collections, to store large volumes of sensor data. Normally, you do not have to create a collection to insert data, but for time-series you do.
db.createCollection(
"ts_readings",
{
timeseries: {
timeField: "ts",
metaField: "meta"
//Optional: granularity or bucketMaxSpanSeconds
}
}
)
We can insert data, and can peek at the underlying collection "db.system.buckets.ts_readings" - the individual readings wouldn't be visible because they are compressed. The data is summarized with "min" and "max" on each bucket (but you will have to rollout your own solution for sum or count).
This isn't without limitations - although the limitations are reducing with every release of MongoDB. Currently, you can delete, you can perform an updateMany with a metafield in the filter condition, and there are certain index types (2d) that aren't permitted. Sharding can be based on the meta field or a combination of the meta field and time field, but not on the time field alone.