so I have been trying to restructure my data in Influx to make more sense and use the database correctly. I am using 1.8 version.
What I came up with is to push all sensor data under same measurement because I have same fields and sensors in this scenario. However, there are things I am wondering about. This sensor has 4 different values, fields. When I add new sensor it will have for example 2 new fields. Should I use separate measurement if they do not have same fields but use same tag-sets (sensorid, locationid, sensortype)?
The second thing is that some of those sensors are lets say from different clients, and will never be called/used together. Would it be correct to somehow split that in a new measurement or database?
For now there are just 50 sensors but in future when there are 10000, would it still be okay to put them under same measurement?
Here are my 2 cents on the architecture :
- DB per client - There is more security this way in accessing the data. It is also a clean separation of data if they do not need to be queried with one another.
- measurement per sensor family - try grouping based on similar fields. Though the other option would be to turn this into a tag and have one measurement. This is up to you.
- Tags look good as they are.
I think both will work but there is no harm in having more than one measurement
Hi @Jay_Clifford ,
Thank you very much. I started some testing with DB per client since their data in should not be related, crossed, queried together in any way, for now.
Grouping per similar fields is going to be complicated. One sensor family, lets say one producer, can have multiple sensors measuring completely different and separate values. In that case I will still need the sensor type and won’t achieve much by splitting them per producer. But grouping them by what they measure might be the “per family” if they lets say have 1-2 different fields.
But then in ex. scenario of 2 sensors
Sensor A measures A B C D in X
Sensor B measure E F in X
Would it be wrong to have that in same measurement because in that case data point 1 would have 2 empty field values E and F and data point 2 would have 4 empty field values A B C and D. But in that case I would have simple query of querying per tag X. If I separate those sensors in 2 measurements then I need to do query for 2 measurements for same tag X. Did I get something wrong or which is more efficient?
If you still have a tag that separates sensors by their type then I see absolutely no issue with this approach and the difference in fields. Separate measurements were just another option if there were distinct families of sensors