Prompt
How do I keep a year of telemetry data without huge storage costs?
Latest observation
To keep a year of telemetry without blowing up storage costs, the main idea is:
store less detail over time, and store it more efficiently.
Here’s a practical approach that works well for most systems:
1) Use a hot/warm/cold retention strategy
- Hot data: full-resolution recent data for fast queries, e.g. 7–30 days
- Warm data: aggregated or compressed data, e.g. 30–90 days
- Cold data: long-term archive, e.g. 1 year, usually downsampled
This avoids paying to keep every raw datapoint at full fidelity for the full year.
2) Downsample older data
Instead of keeping every point forever:
- keep raw data for short-term debugging
- after a certain age, roll it up into:
- 1-minute averages/min/max
- 5-minute or 1-hour aggregates
- percentiles if needed
Example:
- 1-second telemetry for 30 days
- 1-minute aggregates for 1 year
That can cut storage by orders of magnitude.
3) Use compression-friendly storage formats
Telemetry is often repetitive and time-series data compresses well.
Good options:
- columnar formats like Parquet
- time-series databases with built-in compression
- object storage with compressed files
Also consider:
- delta encoding
- run-length encoding
- zstd/gzip compression
4) Partition by time
Organize data by day/week/month so you can:
- delete old chunks cheaply
- query only relevant time ranges
- compress each partition independently
Example partitioning:
telemetry/year=2026/month=01/day=15/
5) Keep only useful dimensions
Storage cost grows fast with high-cardinality tags like:
- user_id
- device_id
- session_id
- request_id
Reduce cost by:
- storing only necessary labels
- hashing or bucketing low-value dimensions
- separating “event metadata” from metric series
6) Archive raw data to cheap storage
If you must retain raw telemetry for compliance or forensics:
- move it to cheap object storage like S3/Blob/GCS
- compress files before archiving
- use lifecycle policies to move older data to colder tiers
7) Sample when full fidelity isn’t needed
If the business doesn’t need every event:
- sample events, e.g. 1%, 10%
- keep all errors and anomalies
- keep full fidelity only for certain devices or periods
8) Separate metrics, logs, and traces
These have very different storage patterns:
- metrics: aggregate aggressively
- logs: filter and compress heavily
- traces: sample adaptively
Trying to treat all telemetry the same is expensive.
A common cost-effective pattern
For example:
- Raw telemetry: 14 days
- 1-minute aggregates: 90 days
- 1-hour aggregates: 1 year
- Rarely accessed raw archives: object storage, compressed
This usually gives you enough history for trends and investigations without paying to store every raw point.
Rule of thumb
If you want to keep a year of telemetry cheaply, ask:
- Do I need raw data for the full year?
- Or do I only need trend visibility for the full year?
- Which fields are actually useful long-term?
If you want, I can help you design a retention plan for your specific telemetry type:
- metrics
- logs
- IoT sensor data
- app performance traces
- server/resource monitoring