Reputation: 359
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...
Upvotes: 0
Views: 1170
Reputation: 7168
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.
Upvotes: 0