Skip to content
Time Series data structure for redis
Branch: master
Clone or download
Latest commit e29ce98 Mar 17, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
RedisModulesSDK @ 79679f6
docs Updating headers of commands documentation Mar 14, 2019
src remove unused struct Mar 17, 2019
.gitmodules fix RedisModulesSDK submodule Feb 15, 2017
LICENSE Update Mar 10, 2019
ramp.yml Merge pull request #57 from RedisLabsModules/license-update Feb 21, 2019

CircleCI GitHub issues

Redis Time-Series Module

Time series data structure for redis.

Using with other tools metrics tools

See RedisTimeSeries organization. Including Integration with:

  1. StatsD, Graphite exports using graphite protocol.
  2. Grafana - using SimpleJson datasource.

Memory model

A time series is a linked list of memory chunks. Each chunk has a predefined size of samples, each sample is a tuple of the time and the value. Each sample is the size of 128bit (64bit for the timestamp and 64bit for the value).


  • Quick inserts (50K samples per sec)
  • Query by start time and end-time
  • Query by labels sets
  • Aggregated queries (Min, Max, Avg, Sum, Range, Count, First, Last) for any time bucket
  • Configurable max retention period
  • Compactions/Roll-ups - automatically updated aggregated timeseries
  • labels index - each key has labels which will allows query by labels


To quickly tryout Redis-TimeSeries, launch an instance using docker:

docker run -p 6379:6379 -it --rm redislabs/redistimeseries


git submodule init
git submodule update
cd src
make all


In your redis-server run: loadmodule

More infomation about modules can be found at redis offical documentation:

Give it a try

After you load RedisTimeSeries, you can interact with it using redis-cli.

Here we'll create a time series representing sensor temperature measurements. Once created, temperature measurements can be sent. Last the data can queried for a time range while based on some aggreagation rule

With redis-cli

$ redis-cli> TS.CREATE temperature RETENTION 60 LABELS sensor_id 2 area_id 32
OK> TS.ADD temperature:3:11 1548149181 30
OK> TS.ADD temperature:3:11 1548149191 42
OK>  TS.RANGE temperature:3:11 1548149180 1548149210 AGGREGATION avg 5
1) 1) (integer) 1548149180
   2) "30"
2) 1) (integer) 1548149190
   2) "42"


Tests are written in python using the rmtest library.

$ cd src
$ pip install -r tests/requirements.txt # optional, use virtualenv
$ make tests


Read the docs at

Mailing List / Forum

Got questions? Feel free to ask at the RedisTimeSeries mailing list.


Redis Source Available License Agreement, see LICENSE

You can’t perform that action at this time.