Addressing
Last updated
Last updated
The following address types are specified for identification of time series in InfluxDB: Path, custom address, and Hash. The address specifies which value should be used for tsid tag as a time series identifier.
"Path" address: Identifies time series by using string path.
Custom text: Identifies time series by using custom text.
"Hash" address: Identifies time series by using hash-function. Hash is calculated as follows: SHA1(ServerUID + TimeSeriesUID). Thus time series gets the following unique global identifier LhdB7l4450F/xs1GjJzHGV+k2VU=. Let’s consider the case of Hash address use. You have 100 one-type distributed Modbus devices to control electrical network parameters. You plan to use 100 instances of Monokot Server to get data from multimeters and to store it in InfluxDB.
By the way for such a large order you will be provided with a very good discount! 🙂
After you configure, debug and start one instance of the server using time series Path addressing everything will operate correctly. But if you upload config of the first server to the second and subsequent instances you will get undesirable effect: data from all servers will be randomly written to the same time series because all server instances have the same addressing.
To solve this problem specify Hash address for all time series. In this case data will be written correctly: each time series specified in the server will be presented by its own time series in the database. Another way of solving this task can be the use of Path addressing together with Add Server UID to Tag flag. This method is more convenient for further queries, but Hash addressing also has its advantages. Hash address is always a fixed-size string (28 bytes). That is why:
Maximum message body size in the writing request becomes predictable and can be calculated.
For example, let’s consider the following path to the time series: DrillingRig.VariableFrequencyDriveHouse.MudCirculatingSystem.VerticalSludge Pump1.Voltage (string size is 90 bytes). Thus when using Path addressing you need to send ~900 bytes to the database server to write just 10 values. Big size of the request increases information network load and reduces InfluxDB performance.
Short values of tags have a positive effect on writing performance into database.
Short values of tags have a positive effect on fetch performance from database.
Disadvantages of using Hash addressing:
Hash is not human “friendly”. For example, the following hash 6ig0pCCEf4XcZZZqacVATbaNJTU= can unambiguously identify time series in the database, but at the same time it doesn’t carry any additional information about the time series. In other words it is impossible to understand which parameter (temperature, pressure, current, torque, etc.) is hidden behind this identifier. In order to map hash address with a certain time series there is a special tool in Monokot Server Administrator which is described below.
After time series is deleted Hash address will be lost forever.