Hi guys,
We are planning to use InfluxDB as a storage for IoT data (sensors and different measurements).
We have that situation:
- 3000 Devices
- Each “typical” device has 8 sensors, (4 temperature sensors, 4 Power consumption sensors). The number of sensors per device can vary and in future maybe there will be other different types of devices with different sensors (not only temperature or power consumption).
- Each sensor sends 4 messages per minute
The typical queries will be per sensor, but i don’t exclude that we’ll need some global statistics. For that i’m planning to use a single measurement, instead multiple measurements (divided by device? Or by measure type).
I’ve some questions:
- Is good to use a single measurement to store that data? Do you see any implication? There is a difference in using single or multiple measurement in terms of memory and cpu usage?
- What is the ideal point structure in this case? We have to choose between these two structures:
- TIMESTAMP | VALUE (FIELD) | SENSOR_ID (TAG) | DEVICE_ID (TAG) -> 1 row for each sensor
- TIMESTAMP | SENSOR_A_VALUE (FIELD) | SENSOR_B_VALUE (FIELD) | SENSOR_C_VALUE (FIELD) | … | DEVICE_ID(TAG) -> 1 row containing the data of all the sensors of the device at time T
Keep in mind that the number of sensors, for some devices, can vary so, for the solution number 2, some rows will have less fields, some rows will require to add more fields (due to more than 8 sensors present). For the solution number 1 the value field will be a float, what we can do if we need to store another type? We must add a new field?
Thank you in advance,
Matteo