0
votes

Is it possible to write more than one point with the same timestamp into one measurement using InfluxDB. Problem is that i am saving data from loggers that have one timestamp and a measurements from many inverters for that timestamp and of course the points are getting owerwritten. How can i fix the problem?

The data is like:

time: 2016-08-09 12:10:08 inverter: 1 ...other fields

time: 2016-08-09 12:10:08 inverter: 2 ...other fields

time: 2016-08-09 12:10:08 inverter: 3 ...other fields

etc...

1
Check if inverter is a tag. If it is a field, then turning inverter to tag should solve your problem.Jagrati
It largely depends on how you design your schema. What are other fields? And what is the 1, 2, and 3 in the example you have above?Michael Desa
The solution was changing field inverter to tag. Now the points are not owerwriten anymore. 1,2,3 are addresses of the inverters. It can be number or string with serial number. Depending on the type of inverter.sanof

1 Answers

0
votes

No, you can't have two entries with the same timestamp for the same measurement.

From the InfluxDB documentation:

Conceptually you can think of a measurement as an SQL table, where the primary index is always time. tags and fields are effectively columns in the table. tags are indexed, and fields are not.

You can however use Influx's high timestamp precision. Your datetime's precision seems to be only seconds. Influx's timestamps are distinguished by nanoseconds. So you might use information such as the inverter index and "encode" it into the nanoseconds. This way, no two entries will collide on the same timestamp.