Advantages of writing to InfluxDB via Line Protocol over Json Protocol

866 Views Asked by At

I am using Python InfluxDBClient for writing to an InfluxDB server. I can either send data via a JSON or this so-called "line protocol."

What are the advantages of using Line Protocol over Json Protocol?

Is there an improvement in writing throughput? Any downside?

1

There are 1 best solutions below

0
On

According the the dev blog post Line Protocol is recommended (https://www.influxdata.com/blog/optimizing-influxdb-performance-for-high-velocity-data/):

  1. Payloads over the wire get much smaller. This helps efficiency…and budget.
  2. Data is more explorable. Note: Having multiple instances of Databases, Measurements, Tags, and Fields makes it easier to see your data in the Chronograf Data Explorer and often makes the meta queries that run this exploration more efficient.
  3. Writes to disk are slightly faster.

So it seems like you get a slight improvement in speed internally in influx, plus an improvement over the wire (since data is more compact). If I have time, I will test this tonight and update my post with results.