Working with time series
As mentioned at the beginning of the chapter, a time series is a sequence of data points collected and recorded over time at regular intervals. Redis Stack provides a rich API to manage data points collected into a time series.
To start with an example, you will need to create a time series. The simplest method to accomplish this is by utilizing the TS.CREATE command followed by a key, representing the time series name, as shown here:
TS.CREATE key
However, there are additional parameters that can be employed when creating the time series, as outlined here:
TS.CREATE key [RETENTION retentionTime] [ENCODING [UNCOMPRESSED|COMPRESSED]] [CHUNK_SIZE size] [DUPLICATE_POLICY policy] [LABELS label value..]
Each parameter can be adjusted for performance optimization, reducing memory footprint, or enhancing querying and aggregation capabilities, as detailed here:
- key: This is the key that identifies the time series.
- RETENTION: This is the retention...