Analytics & ML · Study deck

Time-Series Compression Audit Limits

Picture a rail depot storing wheel vibration every second.

Data Dora is your guide for this deck.

edgetimeseries
Data Dora, the module guide, in a scene from this chapter.
iotclass.org

After studying this chapter

Learning objectives

You will be able to:

  • Explain why regular timestamps and slowly changing values make sensor streams highly compressible.
  • Separate delta, delta-of-delta, and Gorilla-style XOR encoding roles in time-series blocks.
  • Decide when lossless compression is required and when lossy reductions are acceptable.
  • Record compression metadata so cloud analytics can judge audit-grade, trend-grade, or exploratory evidence.
iotclass.org

Major section

Start With the Story

Recent raw detail helps explain a new fault, while year-long trends can use smaller records.

  • The data owner must decide which facts each storage tier must preserve and which later questions a reduction will no longer answer.
  • Encode, decode where possible, and compare counts, times, extremes, events, and summary results.
  • A distant store may hold compact history, but every tier must label its evidence honestly.
  • This opening does not pick one compression method for all streams.
iotclass.org

Major section

Why Compression Follows Sampling

Edge Sampling and Compression teaches the main sampling, aggregation, FFT, semantic extraction, and edge algorithm-selection workflow.

  • This page narrows in on the deeper storage boundary: how a stream can shrink without changing facts, and how to prove which facts were preserved.
  • The separate registry supplies identity without pretending that 240 device records are telemetry.
A valid reading enters authoritative hot history; derived views serve later queries, while archive evidence remains testable through reconstruction.
A valid reading enters authoritative hot history; derived views serve later queries, while archive evidence remains testable through reconstruction.
iotclass.org

Major section

Compress Similar Samples

If the value moves from 3.01 C to 3.02 C to 3.02 C, value deltas or XORs are also small.

  • A sensor emits a relentless stream of timestamped values, and in most streams each value is very close to the one before it, arriving at a very regular interval.
  • These power production time-series databases and cut the amount of data an edge node must ship.
  • Worked example: a refrigerated-truck sensor reports temperature every second.

Key terms

If the timestamp interval
If the timestamp interval is almost always one second, delta-of-delta mostly records zero.
iotclass.org

Major section

Compress Similar Samples (continued)

Two ideas carry most of the gain: encode differences rather than absolute values (they are small when the signal changes slowly), and exploit the bit-level similarity of consecutive floating-point numbers.

  • The changes are tiny, so they need far fewer bits than the full numbers.
  • If the timestamp interval is almost always one second, delta-of-delta mostly records zero.
  • The boundary is fidelity: compression is acceptable only when the receiver can still answer the same question.
iotclass.org

Major section

Practitioner: Delta Encoding and Gorilla

Splitting the work by column is deliberate: timestamps compress best with delta-of-delta (they are almost perfectly regular), while values compress best with XOR (they are numerically similar but not linearly spaced).

  • Worked example continuation: if a gateway receives 10,000 points from one sensor, a row layout repeats timestamp and value metadata for each record.
  • A columnar block instead stores a timestamp column, a value column, and a small header that says which compression method each column used.
  • On readback, the decompressor expands timestamp intervals, applies value XOR or deltas in order, and reconstructs the original point sequence.
iotclass.org

Major section

Lossless, Lossy, and Edge Payoff

Lossless methods must return the exact original sequence, so they are appropriate for billing, compliance, incident review, and any record where a later investigator may ask what the sensor actually reported.

  • Delta, delta-of-delta, run-length, and Gorilla-style XOR encoders are in this family.
  • They exploit regularity, but they do not change the facts.
  • Choosing "best ratio" without naming the decision can erase the signal that matters.

Key terms

Delta and Gorilla
Delta and Gorilla are lossless -- exact reconstruction.
iotclass.org

Major section

Lossless, Lossy, and Edge Payoff (continued)

The edge payoff is mostly radio time.

  • Window aggregation, downsampling, piecewise-linear approximation, FFT peak extraction, and event extraction can reduce a stream far more than lossless compression, but the discarded detail is gone.
  • Sending that raw stream continuously is unrealistic for a battery node.
  • Lossless vs lossyDelta and Gorilla are lossless -- exact reconstruction.
iotclass.org

Major section

Lossless, Lossy, and Edge Payoff (continued)

A trend dashboard may need hourly min, max, and mean; a vibration diagnosis may need spectral peaks; an alarm stream may need threshold crossings and durations.

  • If an FFT window keeps ten frequency bins with frequency, magnitude, and phase, the payload may be roughly 120 to 160 bytes plus metadata.
  • The catch is that the waveform cannot be reconstructed exactly from those peaks, so the raw window must be kept locally or sampled on demand when full evidence is required.
  • Those fields let cloud analytics decide whether a block can support an audit-grade answer, a trend answer, or only an exploratory visualization.
iotclass.org

Major section

Lossless, Lossy, and Edge Payoff (continued)

For more compression, lossy methods (downsampling, piecewise-linear approximation like the swinging-door algorithm) trade a bounded error for smaller size -- fine for trends, not for audit-grade records.

  • Compression saves radio energyOn the edge, transmission dominates the energy budget, so sending 1.4 bytes instead of 16 is a direct battery win as well as a storage win.
  • The CPU-vs-transmit tradeCompression costs cycles on a small MCU.
  • On the edge the payoff is double -- less flash used and, more importantly, far less energy spent shipping data over the radio.
iotclass.org

Deck summary

Key takeaways

Recent raw detail helps explain a new fault, while year-long trends can use smaller records.

  • Edge Sampling and Compression teaches the main sampling, aggregation, FFT, semantic extraction, and edge algorithm-selection workflow.
  • If the value moves from 3.01 C to 3.02 C to 3.02 C, value deltas or XORs are also small.
  • Two ideas carry most of the gain: encode differences rather than absolute values (they are small when the signal changes slowly), and exploit the bit-level similarity of consecutive floating-point numbers.
  • The edge payoff is mostly radio time.
iotclass.org

Retrieval practice

Recall check 1 of 3

Data Dora says: answer from memory, then check your reasoning.

Q1What redundancy does time-series compression primarily exploit?

AConsecutive readings change little and their timestamps are near-regular.
BSensor readings are always random and cannot be compressed effectively.
CEvery recorded value is exactly identical across the full sensor history.
DTimestamps are never stored and therefore need no time-series encoding.
Show answer

Answer: A Small changes and regular intervals make delta-based encoding highly effective.

iotclass.org

Retrieval practice

Recall check 2 of 3

Data Dora says: answer from memory, then check your reasoning.

Q2Why is 'delta-of-delta' encoding effective for the chapter's regularly sampled sensor timestamps?

ADelta-of-delta stores the full timestamp value for each sample.
BDelta-of-delta removes timestamp storage after the first sample.
CTimestamps usually arrive at a fixed interval
DDelta-of-delta works best when timestamps are encoded as text.
Show answer

Answer: C Regular sampling makes differences between successive intervals near zero, so delta-of-delta encoding can represent them compactly.

iotclass.org

Retrieval practice

Recall check 3 of 3

Data Dora says: answer from memory, then check your reasoning.

Q3For an audit-grade sensor log that must reconstruct every value exactly, which compression choice is appropriate?

AA lossy downsample that discards values to obtain a smaller audit log.
BUse no compression because exact reconstruction requires sending the original bytes.
CUse encryption alone as the lossless compressor because ciphertext encodes the source data more compactly.
DA lossless scheme such as delta encoding or Gorilla XOR for exact replay.
Show answer

Answer: D Audit-grade records require lossless compression for exact reconstruction.

iotclass.org

Print reference

Answers

Answer key.

  1. A · Small changes and regular intervals make delta-based encoding highly effective.
  2. C · Regular sampling makes differences between successive intervals near zero, so delta-of-delta encoding can represent them compactly.
  3. D · Audit-grade records require lossless compression for exact reconstruction.
iotclass.org