LinDB on GitHub
  1. Reference
  2. Data Model

Terms of Time-Series

TermDescription
NamespaceCollection of metrics
Metric NameSimilar to the table name in relational database
TagLabel(Key/Value):Multiple tags can be added under each metric
Time SeriesA Time Series is composed of Metric-Name and Tags
FieldMultiple fields can be added under each metric
TimestampTimestamp when a data-point is generated
Data PointData at a specified timestamp

Time-Series Identification

The characteristics of time series can be simply described as follows:

time series characteristictime series characteristic

Each time series is uniquely identified by tags、field and metric-name.

  • Metric Name: records the specific meaning of timing objects (for example, cpu.load, that is, the load of CPU as the monitoring object);
  • Label: A supplementary description of monitoring objects which should be an enumerable string ( for example, host=1.1.1.1, idc=sh, that is, the IP address of the machine is 1.1.1.1, and the idc is in sh). These tags can be filtered and aggregated, such as searching with a single IP Address, searching with multiple IP addresses, searching 50 IP addresses with same prefix, searching all machines in sh;

As shown in the figure, the IP address in the sh idc is 1.1.1.1. At 10:00:00 on January 1, 2019, the CPU load is 10.0, that is, what happens to an object at a certain time.

CAUTION

Try not to use non-enumerable strings as metric-names or tags, such as UUIDs and user IDs.

Field Type

Unlike other time series databases, LinDB supports multiple fields and field types to better handling analysis and calculation in time series scenarios and automatic rollups.

LinDB currently provides a variety of field types, which can be reported to the background service through different SDK. All the original data will be aggregated according to the corresponding field types when they are persisted. The specific types are as follows:

TIP

Data aggregation refers to a time window, such as 5/10 seconds and 1 minute values. For example, Sum can be used for calculating the sum value in 1 minute.

Sum

Sum is an automatic cumulative field. When multiple values are stored or queried, they will be summarized automatically according to the time interval.

You can use Sum to record the number of orders, service errors, traffic and other data in a certain time.

Min

Min is a field that automatically calculates the minimum value. When multiple values are stored, the minimum value will be written according to the time interval. This is also enabled for downsampling queries.

You can use Min to record the lowest temperature of a device in a certain time.

Max

Max is a field that automatically calculates the maximum value. Its function is similar to Min's.

You can use Max to record the maximum temperature of a device in a certain time.

Last

Last is the last value in a certain time, generally representing the latest value.

You can use Last to record the current memory usage, CPU usage, etc.

First

First is the first value in a certain period.

Histogram

Histogram is a compound field that constitutes histogram data. The corresponding data reported by SDK will be disassembled into multiple fields and different buckets to support the calculation of 99 lines, 95 lines, etc.

At the same time, Histogram can additionally record statistical values such as Min/Max/Sum.

Histogram can be used to record the delay of a service processing requests within a certain time.

IMPORTANT

Histogram is widely used as a complex type, and has built-in statistics such as Min/Max/Sum, which means more server resources are needed to store and calculate Histograms.

Previous
State
Next
Metric