Advertisement
Advanced Redis, RedisTimeSeries

How would you design a monitoring system architecture using RedisTimeSeries that efficiently handles both high frequency raw data ingestion and long term historical trend analysis?

Short answer

You would configure a short retention period for high frequency raw data optimized for immediate alerting and detailed recent analysis, set up multiple compaction rules creating progressively coarser aggregated time series such as hourly, daily, and monthly summaries, and…

Save Redis mock interview
Advertisement
AModel answer
You would configure a short retention period for high frequency raw data optimized for immediate alerting and detailed recent analysis, set up multiple compaction rules creating progressively coarser aggregated time series such as hourly, daily, and monthly summaries, and configure appropriately longer retention periods for each of those aggregated series based on how far back you actually need historical trend visibility.
Example

TS.CREATE raw_metrics RETENTION 3600000 TS.CREATE hourly_metrics RETENTION 604800000 TS.CREATERULE raw_metrics hourly_metrics AGGREGATION avg 3600000

Real-world example
A large scale infrastructure monitoring platform maintains raw metrics for just one hour for immediate alerting, hourly aggregates for a week of detailed trend analysis, and monthly aggregates retained indefinitely for long term capacity planning, all automatically maintained through RedisTimeSeries compaction rules.
Likely follow-ups
  • How many levels of downsampling are typically reasonable for a monitoring system?
  • What is the storage tradeoff between keeping more levels of aggregation versus fewer?
Related topics