InfluxDB 简单上手(一)


背景

最近公司的监控项目中用到时序数据库,现在简单介绍学习以下,后面再详细研究。

什么是时序数据?

A time series database (TSDB) is a software system that is optimized for storing and serving time series through associated pairs of time(s) and value(s).In some fields, time series may be called profiles, curves, traces or trends. Several early time series databases are associated with industrial applications which could efficiently store measured values from sensory equipment (also referred to as data historians), but now are used in support of a much wider range of applications.

In many cases, the repositories of time-series data will utilize compression algorithms to manage the data efficiently. Although it is possible to store time-series data in many different database types, the design of these systems with time as a key index is distinctly different from relational databases which reduce discrete relationships through referential models.

简单说,时序数据库就是存储时间序列的数据,用来展示一定时期内的趋势.(随着时间变化而产生新的数据)

时序数据库应用场景?

目前广泛适用于Tesla 自动驾驶、华尔街自动交易算法、智能家居、能够实现日内闪电般运抵的交通网络和纽约市警察局发布的开放数据

在过去的 24 个月中,时间序列数据库(TSDB)已经成为增长最快(最新数据已不是最快)的类别:

时序数据库类别增长趋势:

数据来源:https://db-engines.com/en/ranking_categories

现在可以支持技术选型 InfluxDB ;

InfluxDB 上手入门

1、首先假设你已经安装好InfluxDB (自行百度)

2、启动InfluxDB 命令行

进入: /influxdb-1.6.3-1/usr/bin
执行:./influx

3、概念解释

database 对应数据库中的库

measurement 对应数据库中的表

points 表里面的一行数据

Point由时间戳(time)、数据(field)和标签(tags)组成。

time:每条数据记录的时间,也是数据库自动生成的主索引;

fields:各种记录的值;

tags:各种有索引的属性。

还有一个重要的名词:series

所有在数据库中的数据,都需要通过图表来表示,series表示这个表里面的所有的数据 的图标展示。

4、基本操作

创建数据库

create database mydb

显示所有数据库

show databases;

使用数据库

use mydb;

显示该数据库中所有表

show measurements;

语法参考:https://docs.influxdata.com/influxdb/v1.7/query_language/data_exploration/

第一篇简单上手就到这里,后面逐步剖析原理实现。

展开阅读全文

页面更新:2024-06-03

标签:纽约市   上手   华尔街   简单   表里   时序   日内   序列   算法   智能家居   索引   类别   数据库   时间   数据   科技

1 2 3 4 5

上滑加载更多 ↓
推荐阅读:
友情链接:
更多:

本站资料均由网友自行发布提供,仅用于学习交流。如有版权问题,请与我联系,QQ:4156828  

© CopyRight 2020-2024 All Rights Reserved. Powered By 71396.com 闽ICP备11008920号-4
闽公网安备35020302034903号

Top