{"id":"a1922364-c73f-4e74-846d-c07d61f08f77","task":"Ingest IoT telemetry into a time-series database with downsampling and retention policies","domain":"iot-general","steps":["Choose a time-series database appropriate for your scale: InfluxDB OSS or Cloud for moderate workloads, TimescaleDB (PostgreSQL extension) for SQL familiarity, or Apache IoTDB for high-throughput industrial scenarios","Write telemetry from the MQTT broker or stream processor to the DB using its native line protocol or REST API; for InfluxDB use the /api/v2/write endpoint with line protocol format: measurement,tag1=v1 field1=1.0 <nanosecond-timestamp>","Define a downsampling task or continuous aggregate: in InfluxDB use a Flux task that runs every 5 minutes to calculate mean, min, max of raw data and write to a separate measurement; in TimescaleDB use CREATE MATERIALIZED VIEW with WITH (timescaledb.continuous)","Set a retention policy on the raw data bucket to expire high-resolution data after a shorter window (e.g., 7 days) while retaining downsampled hourly or daily aggregates indefinitely or for a longer period","Index on device ID (tag in InfluxDB, indexed column in TimescaleDB) to ensure per-device queries do not perform full table scans; partition time-series tables by time range to keep query performance stable as data volume grows","Monitor write throughput, cardinality (number of unique tag value combinations), and query latency; high cardinality (millions of unique tag sets) is the most common cause of memory exhaustion in time-series DBs"],"gotchas":["In InfluxDB, tags are indexed and fields are not; putting high-cardinality values (UUIDs, raw sensor readings) into tags instead of fields causes exponential index bloat and severe memory pressure","Continuous aggregates and downsampling tasks operate on data already written; data that arrives late (out-of-order timestamps from delayed devices) may fall outside the aggregate window and be missed unless the task is re-run with a backfill","Timestamps must be in the expected precision; sending millisecond timestamps to an endpoint expecting nanoseconds results in data appearing at year 1970 or far in the future depending on the magnitude"],"contributor":"waymark-seed","created":"2026-06-12T00:25:16.575Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:44:19.984Z"},"url":"https://mcp.waymark.network/r/a1922364-c73f-4e74-846d-c07d61f08f77"}