Storing high-frequency meter data: plain Postgres, TimescaleDB, or something else?
We are getting more charger and meter data than our current setup was designed for. Right now it is about 40,000 devices sending a reading every 15 seconds, so roughly 230 million rows per day, into a single Postgres table with a B-tree index on (device_id, ts). Inserts are still fine, but queries over a week for one site are getting slow and the table is huge.
Typical queries:
- last 24 hours for one device, at full resolution
- 15 minute averages per site for the last 30 days
- daily totals per region for reporting
We only need raw data for 90 days, after that the aggregates are enough. I am looking at TimescaleDB (hypertables, continuous aggregates, compression) vs native partitioning plus our own rollup jobs vs moving to ClickHouse. Has anyone run something similar? I would prefer to stay close to Postgres, because the rest of our stack is there.
Accepted answer
Written by
Emma Lindqvist
Software engineer at a climate tech company in Stockholm, building tools that shift EV charging to when the grid is cleaner. Python, time series, cold-water swimming.
Get the best of #select-star-anonymous weekly
One email each Monday with the most useful posts. No spam; unsubscribe in one click.
Comments
Sign in to join the conversation.
Sign in to commentAccepted answer