Home / Companies / Upstash / Blog / Post Details
Content Deep Dive

Storing Time Series Data in Redis

Blog post from Upstash

Post Details
Company
Date Published
Author
Cahid Arda Oz
Word Count
1,569
Language
English
Hacker News Points
-
Summary

Storing time series data efficiently in Redis is crucial for applications tracking daily metrics, such as stock prices or IoT sensor readings. The exploration starts with basic Redis Lists, which prove inadequate due to challenges with updates and range queries. Sorted Sets offer improvements by using timestamps as scores, but they falter when handling unchanged prices due to their requirement for unique members. Redis Streams, introduced in Redis 5.0, present a more refined solution with natural time ordering, memory efficiency, and support for multiple fields, though they lack native aggregation functions. The ultimate solution is Redis TimeSeries, a module specifically designed for time series data, featuring automatic aggregations and efficient storage, though it is not yet available in Upstash Redis. Currently, Redis Streams are recommended for their balance of performance and functionality, as demonstrated by their use in large-scale applications like QStash and Upstash Workflow, which manage millions of events daily.