
A technical deep dive into interval-aware caching and exponential TTLs for rolling-window dashboards.
This article explores how Netflix addressed scalability challenges in its real-time monitoring systems by building an experimental caching layer for Apache Druid. It introduces an innovative approach of breaking queries into time-aligned buckets to maximize partial result reuse and adjusting cache TTLs based on data confidence.
Highly recommended for engineers facing database scaling issues due to real-time dashboards, particularly those utilizing rolling time windows in time-series environments.
Netflix's large-scale real-time dashboards generated hundreds of queries every 10 seconds, causing standard Apache Druid caches to miss due to shifting time windows and creating redundant database load.
An interval-aware caching layer was developed to bucket query results by time, combined with an 'Exponential TTL' strategy that increases cache duration based on the age of the data.
Achieved an 82% partial cache hit rate for user queries, a 33% reduction in queries reaching Druid, and a 66% improvement in P90 query latency.
Trade-off
The system accepts up to 5 seconds of data staleness and introduces additional architectural complexity and network hops through an external proxy service.
An intelligent caching method that slices query intervals into granular time buckets, allowing previously computed results to be retrieved from cache while fetching only the new data from the DB.
A caching strategy where fresh data gets a short TTL for accuracy, while older, settled data receives exponentially longer TTLs to increase cache persistence.
The practice of caching empty results for sparse metrics to prevent repetitive queries to the database for time periods where no data exists.




