Database Structure - Measurement/Tags/Fields

Hi All,

I’m just beginning to work with database - InfluxDB 2.4 and have a few beginners questions.

I have sensor information (see screenshot) I want to migrate to an InfluxDB Database

Queries I’m going to make are for instance

  • All entities with their value in a certain room
  • All values of a certain entity in a timeperiod
  • All sensors from a certain type in a room with their value
    etc.

What would be the best structure of the DB. I’m thinking

  • Measurement: Entity_ID
  • Field:Entity_Value
  • Tags: Room, Source, Type and Kind

But I’m not sure about the measurement, maybe the entity_id should be a tag?
And is the number of tags necessary, or should that be reduced to be more efficient.
Thx for any advice
PPee

Hello @PPee,
I would drop entity_ID all together it sounds like you have that metatdata encoded in your other tags.
You could add more specificity to your kind tag by replacing:
Energy with energy_today and energy_yesterday respectively for example
Or create a new tag with the entity_ID.

Thanks!

Are you using influxdb to monitor your home? Thats pretty cool!