ADR-0003: PostgreSQL and TimescaleDB
Status
Section titled “Status”Accepted for V1.
Context
Section titled “Context”The platform needs relational customer/device data and long-term telemetry storage.
Existing systems use InfluxDB, but SQL access and relational integration are preferred for this platform.
Decision
Section titled “Decision”Use PostgreSQL with TimescaleDB.
PostgreSQL stores relational platform data.
TimescaleDB stores raw ingestion messages and normalized telemetry where time-series behavior is needed.
Consequences
Section titled “Consequences”Positive:
- SQL-based access.
- Strong relational modeling.
- Good fit for tenant, user, device, and telemetry data.
- TimescaleDB supports hypertables, compression, and time-based retention.
Negative:
- TimescaleDB operations must be understood.
- Long retention requires careful partitioning, compression, indexing, and backup strategy.
- Database-specific behavior must be isolated in repositories and migrations.