InfluxDB 是一个开源分布式时序、事件和指标数据库。使用 Go 语言编写,无需外部依赖。其设计目标是实现分布式和水平伸缩扩展。InfluxDB 包括用于存储和查询数据,在后台处理ETL或监视和警报目的,用户仪表板以及可视化和探索数据等的API。
以下是InfluxDB目前支持的一些功能,使其成为处理时间序列数据的绝佳选择:
- 专为时间序列数据编写的自定义高性能数据存储。 TSM引擎允许高摄取速度和数据压缩
- 完全用 Go 语言编写。 它编译成单个二进制文件,没有外部依赖项
- 简单,高性能的写入和查询HTTP API
- 插件支持其他数据提取协议,如Graphite,collectd和OpenTSDB
- 专为类似SQL的查询语言量身定制,可轻松查询聚合数据
- 标签允许对系列进行索引以实现快速有效的查询
- 保留策略有效地自动使过时数据过期
- 连续查询自动计算聚合数据,以提高频繁查询的效率
InfluxDB 的开源版本只支持一个节点。
示例代码:
//初始化
influxdb = new InfluxDB(host, port, username, password, database);
// with server set timestamps
influxdb.writePoints("some_series", [
{"value": 23.0, "state": "NY", "email": "paul@influxdb.org"},
{"value": 191.3, "state": "CO", "email": "foo@bar.com"}
]);
// with a specified timestamp
influxdb.writePoints("response_times", [
{time: new Date(), "value": 232}
]);
// get the latest point from the events time series
series = influxdb.query(
"select * from events limit 1;");
// get the count of events (using the column type)
// in 5 minute periods for the last 4 hours
series = influxdb.query(
"select count(region) from events " +
"group by time(5m) where time > now() - 4h;");
// get the count of unique event types in 10 second
// intervals for the last 30 minutes
series = influxdb.query(
"select count(type) from events " +
"group by time(10s), type where time > now() - 30m;");
// get the 90th percentile for the value column of response
// times in 1 hour increments for the last 2 days
series = influxdb.query(
"select percentile(value, 90) from response_times " +
"group by time(1h) where time > now() - 2d;");
// get the median in 1 hour increments for the last day
series = influxdb.query(
"select median(value) from response_times " +
"group by time(1h) where time > now() - 1d;");
// get events from new york
series = influxdb.query(
"select * from events " +
"where state = 'ny';");
// get the number of unique users in 1 hour periods
// for the last 48 hours
series = influxdb.query(
"select count(distinct(email)) from events " +
"group by time(1h) " +
"where time > now() - 2d;");
// get the count of events in 10 minute increments
// from users with gmail addresses
series = influxdb.query(
"select count(email) from events " +
"group by time(10m) " +
"where email =~ /.*gmail\.com/;");
InfluxDB 2.0.0 Beta 12具体更新内容如下:
Features
- 8279:通过堆栈将所有 pkg 应用程序设为有状态
- 18322:增加将堆栈现有的(平台中的)资源状态导出为 pkg 的功能。
- 18334:以改进的用法和长格式示例更新了 influx pkg 命令。
- 18344:使用版本和 User-Agent 扩展 Influx CLI。
- 18355:集成了 RedirectTo 功能,因此,CLOUD 用户现在可以在登录后导航回原始链接的页面
- 18392:在模板下合并 pkg influx 命令。这会除去部分 CLI 命令的嵌套。
- 18400:仪表板在 navigating away 后保持排序顺序
- 18480:允许任务在新选项卡中打开
Bug 修复
- 18331:在 DBRP 操作中,除了 ID 之外,还支持 organization name。
- 18335:当向 influx CLI 提供意外错误时,禁用失败。
- 18345:让 influx 删除cmd respect 配置
- 18385:在读取时强制执行 pkger 的存储初始化。
- 18434:Backfill pkger 中直方图缺少的 fillColumns 字段。
- 18471:在切换功能时通知用户如何退出演示模式
UI Improvements
- 18319:在存储区列表中显示存储区 ID 并启用 1 单击复制
- 18361:Tokens list 现在与其他 resource lists 一致
- 18346:切换变量时减少被 hydrated 的变量的数量
- 18447:重新设计仪表板单元的加载指示器,使其更加明显
更新说明:https://github.com/influxdata/influxdb/releases