In a time-series database like InfluxDB, flat time-series data consisting of  [key] [fields] [timestamp] can be inserted in real-time.

e.g. sensor_data,sensorId=ABC,signalStrength=1000 1434055562000

**sensor_data is name of the time-series table

**sensorId is the Key (indexed in table) , used to group the data

 **signalStrength is the value on which a statistical function is applied 

The schema is created on-the-fly along with indices 

Examples of Statistical Functions :

Aggregations

Selectors

Transformations

COUNT()

BOTTOM()

CEILING()

DISTINCT()

FIRST()

DERIVATIVE()

INTEGRAL()

LAST()

DIFFERENCE()

MEAN()

MAX()

ELAPSED()

MEDIAN()

MIN()

FLOOR()

SPREAD()

PERCENTILE()

HISTOGRAM()

SUM()

TOP()

MOVING_AVERAGE()

keep the high precision raw data for only a limited time, and store the lower precision, summarized data for much longer or forever.

 InfluxDB’s continuous queries (CQ) simplify the downsampling process; CQs run automatically and write the query results to another measurement.

e.g. if we have to count the avg signalStrength per sensor , then we execute the query 

select mean(signalStrength) from sensor_data where deviceGroup = ? group by sensorId, time(1h) into sensor_signal_count

select percentile(mean(value), 50) from sensor_data group by sensorId, time(1h)

select percentile(mean(value), 75) from sensor_data group by sensorId, time(1h)

select percentile(mean(value), 95) from sensor_data group by sensorId, time(1h)

select percentile(mean(value), 99) from sensor_data group by sensorId, time(1h)

more details – https://docs.influxdata.com/influxdb/v0.13/query_language/data_exploration/

if we use the Kapacitor DSL  along with Influx DB , then one can easily configure the Continuous Queries along with Alerts and interesting UDFs (to leverage derived stats functions like Anamoly Detection)

summary tables per measurement type can be created on-the-fly with expiry time

InfluxDB Sizing

Load

Writes per second

Queries per second

Unique series

Low

< 5 thousand

< 5

< 100 thousand

Moderate

< 100 thousand

< 25

< 1 million

Low load recommendations 

  • CPU: 2-4
  • RAM: 2-4 GB
  • IOPS: 500

Moderate load recommendations

  • CPU: 4-6
  • RAM: 8-32GB
  • IOPS: 500-1000
Advertisements