Interested in using Influxdb & flux for IOT

iot
influxdb
#1

I have an IOT usecase, where I would want to utilize Influx & flux in future. I have doubts against which, I am unable to find answer:

  • Typical IOT data, contains sensor values, and some other information to describe that sensor (Location, type, product id etc). Some of this description is not permanent, and may be changed in future. I was thinking of using tags but, I am not able find if it is possible to add or remove tags
  • It is important use case, if I want use & exploit efficiencies of query engine.

Can anyone suggest, a solution to this ?

#2

I don’t think you can simply remove tags as such, they’re part of the series and are used as part of the indexing (i think), so removing them would potentially destroy your data series.

To remove the tags from the database you would need drop the series. You could modify/add a new tag at a later date, but this just creates a new series which in turn would increase your series cardinality, possibly resulting in less performant queries further down the line.

If you were to set the tag for the sensor/host as ‘sensor’ or ‘host’ and added a second tag that grabs the value dynamically from the data you’re polling, you could update the tags as you go along. At least then you could group your metrics together based on the host and then filter the results further using the second tag. Still, this would have an impact on cardinality and eventually performance.

In essence, if the value is going to change frequently then you might want to consider storing some of the descriptions as fields instead.

My TICK stack is a couple of version out of date so the newer versions might work as you want, i haven’t tested. One thing i do know is we were storing guid’s as tag values, the cardinality was too high and we overloaded two nodes with 200gb of memory each.

This GitHub Issue has been open regarding this, it is a bit old now but is still active.

Probably not the answer/solution you were looking for, but hopefully it helps in some way.

1 Like