Hello,

I would like to ask schema design advise for the following use case:

I want to collect time series data of trips of cars.
I collect about 20-30 different metrics per trip (like speed, rpm, location, temperature etc.) with different frequencies ranging from 3 seconds to 1 minute.
A car generates about 150-300 trips in a month, 2000-3000 trip a year.

I have some data about the trips stored in an rdbms like trip_id, car, driver, start datetime, end datetime and many more and I want to store only the raw, collected time series data in influxdb. Among the raw data collected from the cars I have to calculate additional time series data derived from the collected data, like fuel consumption and also single values like distance, average speed etc. typically when a trip ends.

I had/have the following ideas in my mind:
1. My first naive approach was to just simple store every trip's data in its own measurement (trip_<trip_id>) without any tags but that would generate a huge amount of series sooner or later. Since then I've learned that series cardinality matters the most in terms of memory usage and performance so it's obviously not a good choice. So any option that would use the trip ids as tag values sounds like a really bad idea because I'll have a lot of trips. 2. Store all the data in a single measurement and use for example the car id as a tag. That would generate giant amount of points in a single measurement (is it a problem?) and would make horizontal partitioning of the data difficult if I'd need to use multiple hosts / databases later. 3. Measurement / per car, no tags. This seems like the best approach for me at the moment. Horizontal partitioning would be relatively trivial using car id as shard key if the number of cars on the system increases. Series cardinality would equal with car cardinality. Obviously in order to get only the data of a single trip (which is important) I'd have to rely on the meta data (the trip's start and end time) stored in the rdbms. That is true for 2. as well.

I'm open to new ideas as well. What do you think?

Thanks
Zoltan

--
Remember to include the InfluxDB version number with all issue reports
--- You received this message because you are subscribed to the Google Groups "InfluxDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/influxdb.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/influxdb/f5bb0779-f2ac-d9f3-7078-9709d6369714%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to