首页 > 解决方案 > 通过线路协议写入 InfluxDB 优于 Json 协议的优势

问题描述

我正在使用 Python InfluxDBClient 写入 InfluxDB 服务器。我可以通过 JSON 或这种所谓的“线路协议”发送数据。

使用 Line 协议优于 Json 协议有什么优势?

写入吞吐量有改善吗?有什么缺点吗?

标签: influxdbinflux-line-protocol

解决方案


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.


推荐阅读