FIELD NOTESAWS · ARCHITECTURE

IoT telemetry on AWS: a time-series database or an S3 landing zone?

IoT Core to Managed Grafana, decided by how fast an operator must see a fault. Why the alert belongs in the rule and a CloudWatch alarm, when Timestream for InfluxDB earns its always-on bill, and when S3 and Athena are enough.

By Zorp4 min readPublished
ON THIS PAGE
Open original
AWS IoT monitoring: machines and sensors publish over MQTT with mutual TLS to AWS IoT Core; an IoT rule invokes a Lambda that normalises readings into a time-series database, and the operations team signs in through IAM Identity Center to Managed Grafana dashboards with alerts. Drawn in archhy.

Where device telemetry should land on AWS depends on one number: how many seconds may pass between a machine going wrong and a person seeing it on a screen. If an operator watches the last hour live, put a time-series database behind the IoT rule and point Managed Grafana at it. If faults are found in trends over days, land everything in S3 and query it with Athena, and stop paying for a database that runs all night for nobody. Either way, the alert should not wait for the database at all.

Based on the diagram and article from archhy, our sister product for architecture diagrams: AWS IoT monitoring architecture with Managed Grafana. The reference design from IoT Core to Grafana is drawn there step by step, with a copy you can edit.

Separate seeing a fault from storing readings#

The usual drawing runs one line from device to rule to database to dashboard, as if the database were part of the alarm. It is not. An IoT rule evaluates every message as it arrives, so it can raise an alert seconds after the reading leaves the machine, whatever happens to the reading afterwards. Once alerting lives in the rule, the storage question gets smaller: it is about how quickly someone must be able to look back at the readings, not how quickly they must be told.

One trap: a rule has no memory. A WHERE temperature > 85 rule wired straight to SNS fires on every hot reading, so a machine that reports each second sends sixty messages a minute while it stays hot. Send the value to a CloudWatch metric instead, and let an alarm decide, for example three bad one-minute periods out of five. Configure actions for the ALARM and OK state changes to notify on both onset and recovery.

Plain text
-- rule "line_health": a CloudWatch metric action, alarmed in CloudWatch
SELECT temperature FROM 'factory/+/telemetry'

-- rule "land_all": a Firehose action to S3, plus an InfluxDB action for the hot path
-- (each payload already carries an integer epoch "timestamp")
SELECT * FROM 'factory/+/telemetry'

The hot path: a time-series database#

Choose it when the people watching need the last few hours at second-level detail, moving as they look: a control room, a shift lead chasing a fault on the line. Note the change since most reference designs were drawn: Timestream for LiveAnalytics stopped taking new customers on 20 June 2025, and AWS points new builds to Timestream for InfluxDB. IoT Core now has an InfluxDB rule action that writes each message as line protocol, and Managed Grafana reads InfluxDB as a built-in data source.

Check the action requirements before you commit. The action takes JSON with an integer epoch field named exactly timestamp in each object, and the database must be reachable from IoT Core over HTTPS. The bill is shaped differently too. Timestream for InfluxDB is priced per instance-hour while the instance is provisioned, plus storage, so it costs the same at three in the morning when nobody is looking. Keep its retention short (days, not years) and it stays a small instance.

The cheap path: S3 and Athena#

A Firehose action on the rule batches readings into S3 objects; Athena queries them in place, and Grafana's Athena data source draws the dashboards. S3 storage continues to accrue when nobody is querying. With on-demand Athena, scan charges depend on the queries you run, including dashboard refreshes. Firehose defaults to buffering hints of 300 seconds or 5 MiB for S3 delivery. Cutting the interval to zero buys many tiny objects, more S3 requests and slower queries, which defeats the point. Partition the objects by date and machine so a dashboard scans one day, not the whole fleet's history.

For most fleets the answer is both. One rule can carry several actions: everything goes to S3 forever, and InfluxDB holds a short window for the control room. If no one would open a live graph during a fault, drop the hot path and let the alarm do the urgent work.

Messaging is charged per message before any storage decision, so the reporting interval is the first cost lever: a device that reports every second sends sixty times as many messages as one that reports every minute. Devices that only feed rules can publish to the Basic Ingest topic, $aws/rules/<rule-name>/…, which skips the message broker and its messaging charge. Rule actions are still charged. The same thinking about what each consumer needs, and when, runs through event-driven architecture on AWS and the event-driven invoice pipeline.

On Google Cloud and Azure#

Azure keeps the same shape. IoT Hub is the device endpoint, Azure Data Explorer ingests continuously from its built-in endpoint as the hot store, and Azure Managed Grafana reads it. IoT Hub message routing to Blob Storage is the cold landing zone. Google Cloud retired IoT Core on 16 August 2023, so devices reach Google Cloud through a partner or self-run MQTT broker that publishes to Pub/Sub. From there a BigQuery subscription is the cheap landing zone, and Bigtable serves the second-by-second view.

The diagram#

archhy's diagram shows the hot path: machines publishing over MQTT with mutual TLS to IoT Core, a rule and a normalising Lambda writing to a time-series database, and operators signing in to Managed Grafana. Open the source diagram in archhy and use its editor link to add the S3 landing zone beside it.

Reference documentation: IoT InfluxDB action, Timestream availability, Firehose buffering, IoT Basic Ingest, Azure IoT Hub to Azure Data Explorer, Pub/Sub BigQuery subscriptions.

Go deeper#

archhy's full article walks through each component of the reference design, the security and timestamp choices, when not to build it, and how to draw it yourself in archhy.