Time-Series Compression: Storing More with Less

Time-series compression stores data more efficiently by saving the *difference* between consecutive points, not the full values. It's key for managing terabyte-scale monitoring and IoT data, often saving over 90% on storage.
Why it exists
Time-series data, common in system monitoring and IoT, accumulates rapidly because new measurements are always inserted instead of updated. This leads to massive datasets, often terabytes or larger, resulting in significant storage costs and slower query performance. These specialized compression algorithms were developed to make storing and querying this data feasible and cost-effective.
The mental model
Think of time-series compression like describing a walk. Instead of listing your exact GPS coordinates every second, you state your starting point and then just say "one step forward, one step forward, turn right." Because the changes are small and simple, the description is much shorter. Similarly, these algorithms store a full initial value, then encode the small, subsequent changes (deltas) using far fewer bits.
How it works
A suite of lossless algorithms is used, each tailored to specific data patterns. Delta encoding stores the difference between consecutive values. Delta-delta encoding takes it a step further, storing the difference of the differences, which is highly effective if the rate of change is constant. For floating-point numbers, XOR-based compression compares the bit patterns of adjacent values. Since they are often very similar, the result of a bitwise XOR operation has many zeros, which can be compressed efficiently.
When to use it
Use these algorithms for any data that is recorded sequentially over time and where values are often similar to their neighbors. This is ideal for IT infrastructure metrics (CPU, memory), IoT sensor readings (temperature, pressure), and financial data (stock prices). The primary benefit is a drastic reduction in storage costs (often over 90%), with a secondary benefit of faster queries since less data needs to be read from disk.
When not to use it
Avoid these techniques for data that is not sequential or ordered. They are ineffective on datasets like user account tables or product catalogs, where one record has no predictable numerical relationship to the next. The "delta" between two unrelated records would be large and random, offering no compression advantage and adding unnecessary CPU overhead.
One canonical example
An application's memory usage is recorded every minute: 100.1MB, 100.2MB, 100.3MB. Instead of storing three full floating-point numbers, a system can use delta-delta encoding. It stores the initial value (100.1), the first delta (+0.1), and the delta of the deltas (the change between subsequent deltas, which is 0). The sequence becomes 100.1, +0.1, 0, which can be stored using significantly fewer bits than the original values.
Interview question
What is the primary reason time-series compression achieves significant storage savings for data like sensor readings?
- a.It converts all numerical data into a fixed-length binary format, which is inherently smaller.
- b.It removes duplicate entries and aggregates data points into averages over time intervals.
- c.It encodes the small, predictable differences between consecutive data points rather than their full values.Correct
- d.It stores a complete timestamp and value for every single measurement, ensuring high fidelity.
Why? this is the answer
The card explicitly states that time-series compression works by storing the 'difference between consecutive points' or 'subsequent changes (deltas),' which is the core mechanism for its efficiency. Option B describes aggregation or deduplication, which is a different data reduction technique not primarily described as the compression mechanism here.
Just read this? Test yourself on what you have been reading.
Read the original → tigerdata.com
- #time-series
- #compression
- #sre
- #monitoring
- #databases
You just looked this up. Could you explain it out loud?
That is the part interviews actually test. Tezvyn takes questions like this one and gives you what the interviewer is really checking, the answer that lands, and the mistake that ends the conversation, in the four minutes before your next meeting.
The iPhone app is on the way
We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.
Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.
We are hiring for this. Every open role lists the topics its interview covers, so you can prepare for the real thing rather than guessing.
See open roles