Reading through the documentation, I found examples of a single field per measurment:
- Measurement: cpu, Tag(s): host/region, Field(s): value
- Measurement: foodships, Tag(s): park_id/planet, Field(s): #_foodships
- Measurement: weather_sensor, Tag(s): crop/plot/region, Field(s): temp
And two fields per measurement:
- Measurement: orders, Tag(s): -, Field(s): phone/website
- Measurement: payment, Tag(s): device/product/method, Field(s): billed/licenses
- Measurement: stock, Tag(s): symbol, Field(s): bid/ask
- Measurement: temperature, Tag(s): machine/type, Field(s): external/internal
- Measurement: census, Tag(s): location/scientist, Field(s): butterflies/honeybees
- Measurement: h2o_feet, Tag(s): location, Field(s): “level description”/water_level
- Measurement: weather, Tag(s): location, Field(s): temperature/bug_concentration
For all the examples with two fields, what is the benefit over just adding a tag? For instance, orders could use tag source (phone/website), temperature could use source location (external/internal), etc.
The first five two field examples in a sense have the same measurement but separated based on what they are applied to (type or location), the second to last has one field which is dependent upon the other (is this bad design?), and the last has two fields which are totally different. Are there implications of taking one approach over the other?
Several other potential examples which I thought of are as follows. Are these good uses?
- Measure a vector (i.e. velocity is speed and direction).
- Measure single phase power (volts, amps, phase).
- Measure three phase power (volts, amps, phase for each phase).
What should one do if a sensor type is used in a measurement with a single field and a second measurement in another field? For instance, there are many voltage measurements but a couple power measurements which share the same voltage.
What criteria makes using multiple fields per measurement a good or bad choice? For instance:
- All fields have values for each inserted timestamp (Ah, this is a must have! Per https://docs.influxdata.com/influxdb/v1.3/concepts/glossary/#field-value, NULL is not supported. This would require using zero or something if a value wasn’t provided which is not correct.).
- All fields receive data from the same device (probably not important).
- Common queries include an aggregate function on both fields over the same GROUP BY duration.
- Anything else?
EDIT. A little off topic, but how application specific should a measurement be? For instance, temperature when BBQing a rib eye steak is pretty specific and tags can be the chief, quality grade of meat, etc. But plain old temperature as a measurement can span from my steak example, the temperature on Pluto, and the temperature of the coals of my BBQ do not seem to have much in common. Maybe when BBQing something with a tag of what is being BBQ’d could work…