Redis Time Series

advantages

Redis Time Series

Redis Time Series is the redis module developed by Redis to enhance your experience in managing the time series data with Redis.

Redis is not only meant for the cached database. It can be used as database for the on-premise project and push the data to the cloud depends on the memory of the system.

My current project is running with full fledged redis db storing all the data in the Json stringify format using HashMaps without persistent and using the Redis Time Series for persistent time series data.

One way to store the time series data in Redis is using Sorted Sets in which the score is used as the timestamp and value as the measurement at that time.

ex ZADD tags 202017234567 “70”

Storing the data in the Sorted Set has following drawbacks -

1) Sorted sets are not memory efficient data structure. 2) Insertion takes longer as the set becomes larger.

RedisTimeSeries

It is new data type that uses chunks of memory with fixed size for time series samples indexed by the same Radix Tree Implementation as Redis Stream.

Install - npm i redis-time-series-ts in the Node JS application. You will be able to use the package.

Advantages of Redis Time Series 1) You can apply retention policy in milliseconds which means that stored data can be saved according to your wish, after the mentioned milliseconds data would be trimmed automatically from the Redis Storage. 2) You can allocate the memory size for the each redis timeseries key. 3) You can apply downsampling with which you can keep fewer historical data points by aggregating the raw data samples for the given time window using aggregating functions such as avg,sum,min,max,range,count etc. 4) Filters can be applied using the FilterBuilders.

RedisTimeSeries is powerful and faster for time series database to use it analytic plots.

Hope this would give rough idea about the Redis Time Series.