Introduction
- Time Series DB (TSDB) : a DB optimized for time-stamped or time series data.
- ex) server metrics, network data, sensor data, …
1. Data Elements
| _time | _measurement | location | scientist | _field | _value |
| -------------------- | ------------ | -------- | --------- | ------ | ------ |
| 2019-08-18T00:00:00Z | census | klamath | anderson | bees | 23 |
| 2019-08-18T00:00:00Z | census | portland | mullen | ants | 30 |
| 2019-08-18T00:06:00Z | census | klamath | anderson | bees | 28 |
| 2019-08-18T00:06:00Z | census | portland | mullen | ants | 32 |
-
Timestamp (
_time) :- All data stored in influxDB has a
_timecolumn that stores timestamps.
- All data stored in influxDB has a
-
Measurement (
_measurement) :- acts as a container for tags, fields, and timestamps (as ‘Table’ in RDBMS)
-
Tags (
location,scientist):- Tags are indexed
- Tags are optional. You don’t need tags in your data structure. But InfluxDB indexes tags, the query engine doesn’t need to scan every record in a bucket to locate a tag value.
- tag key : location, scientist in sample data
- tag value : The tag key location has two tag values : klamath and portland
- tag set : The collection of tag key value pairs
location=klamath, scientis=anderson…
- Tags are indexed
-
Field (
_field) :- field key : the name of the field
- field value : strings, floats, integers, or booleans.
- field set : A collection of field key-value pairs associated with a timestamp. The sample data includes two field sets:
census bees=23i,ants=30i 1566086400000000000census bees=28i,ants=32i 1566086760000000000
-
Series
- series key : is a unique combinaion of measurement, tag set, and field key.
- series (value) : includes timestamps and field values for a given series key
-
Point
- includes the series key, a field value, and a timestamp
2019-08-18T00:00:00Z census ants 30 portland mullen
- includes the series key, a field value, and a timestamp
-
Bucket
- combines the concept of database and a retention period
-
Organization
- a workspace for a group of users : All dashboards, tasks, buckets, and users belong to an organization
2. Write Data - Best Practicies
- 2.4 Handle duplicate data points
- InfluxDB identifies unique data points by their measurement, tag set, and timestamp
- To preserve duplicate points
- (1) Add an arbitraty tag with unique values so InfluxDB reads the dups as unique
- (2) Increment the timestamp : by a nanosecond to enforce the uniqueness of each point.