InfluxDB
- Time Series DB
- open source
- Golang
[祝]version 1.0 release
もとめていたもの
DBやKVSなどをあえてストック、フロー、ワークという分け方で考えるとすれば、フロー
InfluxDB install
Creating a database
InfluxDBへ接続
>influx
DATABASE作成
CREATE DATABASE mydb
USE mydb
gem influxdb-ruby
gem 'influxdb'
sample
data = [
{
series: 'cpu',
tags: { host: 'server_1', region: 'us' },
values: { internal: 5, external: 0.453345 }
},
{
series: 'gpu',
values: { value: 0.9999 },
}
]
influxdb = InfluxDB::Client.new ENV['INFLUXDB_DATABASE'], ['INFLUXDB_USERNAME'], ['INFLUXDB_PASSWORD']
influxdb.write_points(data)
- series
テーブル - tags
インデックスみたいなもの - values
カラムと値(key-value?)
Time series data refers to the composition of metrics and tags.
A metric is an arrangement of numerical data in a successive time order,
consisting of a title and several time-value pairs.
Usually time series data is enriched by tags.
- Regular – data that is sampled at regular intervals. For example every second, or every hour.
- Irregular – for example, data that is only recorded when an event occurs, which might happen frequently, but always at completely random times.
Queries
- sampleデータと簡単なQuery例
https://docs.influxdata.com/influxdb/v1.0/query_language/data_download/ -
continuos
関数やトリガーみたいなものが作れる
graph
副産物
おわりに
- 大量ログデータのリアルタイム監視などに使えそう
- 伝統的なファイル出力に替わる時代が来るかも
- Time is in-out of joint
イベントに関する頻度と経過時間、
そして関連性をより細かく適切に把握できるツールを
使いこなすには意識が必要