7
Database
SQL vs NoSQL for an IoT telemetry platform
Query power ↔ Write scale
Context
Store 2B sensor readings/month with 90-day hot retention.
Sensors report every 10 seconds. We need per-device time-range queries (fast), fleet-wide aggregates (hourly is fine), and 90 days of hot data before archiving to S3.
Timescale gives us SQL and continuous aggregates. DynamoDB gives us effortless write scale but aggregates mean streaming to something else.
Constraints
- Writes
- ~800/s sustained
- Retention
- 90 days hot
PostgreSQL + TimescaleDBvsDynamoDB / NoSQL
Community verdict
PostgreSQL + TimescaleDB 67%DynamoDB / NoSQL 33%
9 engineers · 2 opinions
With these constraints, what would you choose?
One choice per engineer. You can change it any time.
PostgreSQL + TimescaleDB
DynamoDB / NoSQL
Write scale →
Trade-offs
Dimensions
PostgreSQL + TimescaleDBDynamoDB / NoSQLout of 5
- Query power
- 5PostgreSQL + TimescaleDB scores 5 of 52DynamoDB / NoSQL scores 2 of 5
- Write scale
- 4PostgreSQL + TimescaleDB scores 4 of 55DynamoDB / NoSQL scores 5 of 5
- Cost at rest
- 4
Community discussion
2 comments
Have you made this decision in production? Share your reasoning.
Sign in to commentTimescale hypertables with compression got us 10–15x storage reduction, and continuous aggregates replaced an entire Spark job. 800 writes/s is comfortable on a single node.
DynamoDB with a device-id partition key and time sort key handles the per-device queries perfectly. For fleet aggregates, DynamoDB Streams → Firehose → Athena is cheap and zero-maintenance.