This document presents RedisTimeSeries, which provides time series functionality for Redis. It defines a time series as a series of data points indexed in time order. RedisTimeSeries allows ingesting, querying, aggregating, and downsampling of time series data stored in Redis in a more optimized way than traditional Redis methods. It provides features like labeling of time series for enhanced queries, aggregation functions, and integration with tools like Prometheus and Grafana. The presentation includes demos of using RedisTimeSeries to store and analyze weather station and web page view count data.
2. PRESENTED BY
What is a Time Series?
A time series is a series of data points indexed (or listed or graphed)
in time order. Most commonly, a time series is a sequence taken at
successive equally spaced points in time. Thus it is a sequence
of discrete-time data.
What you wrote, Wikipedia
*time series data is append-only
11. PRESENTED BY
• Each Key is a time series
• Each Key can have multiple downsampling rules
– Each downsampling rule will write to a different key
• Each time series can have any set of labels
• Sharding is simple - just shard by the key name
RedisTimeSeries Basics
14. PRESENTED BY
Labels
• A label is a key value pair
– Example: sensor=12
• Each Key can have multiple labels
• Indexed internally as a secondary index based on Redis hashes (aka RAX)
• Used for multi time-series queries
– Filtering operator including: equals (=), not equals(!=), contains key(=“”), does not contain a
key(!=“”)
– Example: TS.MRANGE 1553973212 1553973656 FILTER region=us-west-1 app=frontend
18. PRESENTED BY
Toolset
• Docker-compose running
– Redis + RedisTimeSeries with automatic downsmapled keys max,min
and average for 1 min
– Prometheus
– Grafana
• Python
• Web Browser
19. PRESENTED BY
Data model
• Simple weather station
– Each station reports Temperature and Humidity every second
• Goals
– Monitor 2 metrics from multiple sensors
– Create dashboard
20. PRESENTED BY
How do I ingest data?
• TS.ADD KEY 1553828843 123
• TS.ADD KEY * 123
• TS.ADD KEY * 123 LABELS sensor 1 room 21
• TS.ADD KEY 1553828843 123 LABELS sensor 1 room 21
22. PRESENTED BY
Data model
• Keep track of page views
– Each visitor is counted on every page
• Goals
– Be able to query:
• Latest view count
• History of page views
• History of page views per region
– Dashboard
23. PRESENTED BY
How do I ingest data?
• TS.INCRBY KEY INCER VALUE [LAEBLS key value ]
– Each visitor is counted on every page
• Goals
– Be able to query:
• Latest view count
• History of page views
• History of page views per region
– Dashboard
25. PRESENTED BY
Next steps
• Double delta compression
• Redis search integration
• Support all common timeseries use cases
• A more complete benchmark
– Based on TSBS
26. PRESENTED BY
Get RedisTimeSeries
• https://oss.redislabs.com/redistimeseries/
• https://github.com/RedisLabsModules/RedisTimeSeries/
• Demos:
https://github.com/danni-m/redisconf19-demo