Do you think IIT Guwahati certified course can help you in your career?
No
Introduction
Redis Time Series is a Redis module that adds a time series data structure to Redis. A time series is a collection of memory bits connected together. Each chunk has a predetermined sample size. Each sample is a 128-bit tuple, with the timestamp and value separated by 64 bits.
Creating a TimeSeries
The TS.Construct command can be used to create a new TimeSeries; for example, run the following: TS to make a timeseries named sense, run the following:
TS.CREATE sense
With the RETENTION option, you can prohibit your timeseries from increasing forever by defining a sample age restriction compared to the last event time. The default retention value is 0, which indicates that the series will not be trimmed.
TS.CREATE sense RETENTION 2678400000
This will create a timeseries called sense and trim it to values of up to one month.
Features
High volume inserts, low latency reads
Query by start time and end-time
Aggregated queries (min, max, avg, sum, range, count, first, last, STD.P, STD.S, Var.P, Var.S, twa) for any time bucket
Configurable maximum retention period
Downsampling/compaction for automatically updated aggregate timeseries
Secondary indexing for time series entries. Each time series has labels (field value pairs) which will allow querying by labels.
Client libraries
RedisTimeSeries contains a number of client libraries that abstract the API in several programming languages and were built by the module authors and community members.
While using the raw Redis commands API is possible and straightforward, it is usually more convenient to use a client library that abstracts it.
Using other tools metrics tools
In the RedisTimeSeries organization, you can find projects that help you integrate RedisTimeSeries with other tools, including
Prometheus - read/write adapter to use RedisTimeSeries as backend db.
Grafana 7.1+ - using the Redis Data Source.
Telegraph
StatsD, Graphite exports using graphite protocol.
Prometheus
Redis TimeSeries Adapter gets Prometheus metrics through remote write and uses the TimeSeries module to write them to Redis.
To build the project:
make build
cd bin
To send metrics to Redis, provide the address in host:port format.
redis-ts-adapter --redis-address localhost:6379
To receive metrics from Prometheus, Add remote write section to prometheus configuration:
Grafana's Redis Data Source is a plugin that allows users to connect to any Redis database, both on-premises and in the cloud. It includes pre-built dashboards and allows you to create custom dashboards to monitor Redis and application data.
Redis Data Source can be downloaded through the Grafana Marketplace or installed using the grafana-cli command line tool:
Telegraph is a collection, processing, aggregation, and writing agent for metrics. Based on a plugin framework that allows community developers to simply add support for new metric collecting. There are four distinct types of plugins:
Input Plugins gather data from the system, services, and third-party APIs.
Processor Plugins decorate, transform, and filter metrics
A time series is a linked list of memory chunks. Each chunk has a predefined size of samples. Each sample is a 128-bit tuple: 64 bits for the timestamp and 64 bits for the value.
Frequently Asked Questions
Is Redis a timeseries database?
The RedisTimeSeries module makes using Redis for time-series applications like IoT data, market prices, and telemetry much easier. You may consume and query millions of samples and events at the speed of Redis with RedisTimeSeries.
What is the Redis time series?
A time series is a collection of memory bits connected together. Each chunk has a predetermined sample size. Each sample is a 128-bit tuple, consisting of 64 bits for the timestamp and 64 bits for the value.
Is Redis good for real-time?
With streaming technologies, Redis can be used as an in-memory data storage system like Apache Kafka and Amazon Kinesis to ingest, process, and analyze real-time data with sub-millisecond latency. For real-time analytics use cases, including social media analytics, ad targeting, personalization, and IoT, Redis is an excellent solution.
Conclusion
In this article, we have extensively discussed the way of adding Time Series API with Redis stack.
We hope that this blog has helped you enhance your knowledge regarding Time Series API with Redis stack.