InfluxDb系列:几个关键概念(主要是和关系数据库做对比)
https://docs.influxdata.com/influxdb/v0.9/concepts/key_concepts/
#,measurement,就相当于关系数据库中的table,他就是tag,field,time的容器;
#,对于influxDb的measurement来说,field是必须的,并且不能根据field来排序;
#,Tag是可选的,tag可以用来做索引,tag是以字符串的形式存放的;
#,retention policy,保留策略,用于决定要保留多久的数据,保存几个备份,以及集群的策略等;
#,series,a series is the collection of data that share a retention policy, measurement, and tag set,
比如对于下面这个measurement,
name: census
-————————————
time location scientist butterflies honeybees
2015-08-18T00:00:00Z 1 langstroth 12 23
2015-08-18T00:00:00Z 1 perpetua 1 30
2015-08-18T00:06:00Z 1 langstroth 11 28
2015-08-18T00:06:00Z 1 perpetua 3 28
2015-08-18T05:54:00Z 2 langstroth 2 11
2015-08-18T06:00:00Z 2 langstroth 1 10
2015-08-18T06:06:00Z 2 perpetua 8 23
2015-08-18T06:12:00Z 2 perpetua 7 22
-————————————
time location scientist butterflies honeybees
2015-08-18T00:00:00Z 1 langstroth 12 23
2015-08-18T00:00:00Z 1 perpetua 1 30
2015-08-18T00:06:00Z 1 langstroth 11 28
2015-08-18T00:06:00Z 1 perpetua 3 28
2015-08-18T05:54:00Z 2 langstroth 2 11
2015-08-18T06:00:00Z 2 langstroth 1 10
2015-08-18T06:06:00Z 2 perpetua 8 23
2015-08-18T06:12:00Z 2 perpetua 7 22
他有下面这四个series
Arbitrary series number | Retention policy | Measurement | Tag set |
---|---|---|---|
series 1 | default | census | location = 1 ,scientist = langstroth |
series 2 | default | census | location = 2 ,scientist = langstroth |
series 3 | default | census | location = 1 ,scientist = perpetua |
series 4 | default | census | location = 2 ,scientist = perpetua |
这个其实比较好理解,其实一个series就是一个测点,或者说一条曲线,那么retention policy, measurement, tagset就共同组成了一个定位测点序列的唯一标识。
Understanding the concept of a series is essential when designing your schema and when working with your data in InfluxDB.
#,point,就是某个series的同一个时刻的多个field的value,就组成了一个point;其实就是一般曲线上的一个点。
#,InfluxDb不需要做schema定义,这意味着你可以随意的添加measurements, tags, and fields at any time,