Cloud Parts

IoT telemetry pipeline

Devices stream readings into Kinesis; Lambda writes them to TimescaleDB for Grafana, and raw data is archived to S3.

Fits: Fleets of devices, metrics or clickstreams5 technologies
Live model
What you’re watchingDevice readings append to a Kinesis stream. Lambda reads small batches into TimescaleDB, where Grafana’s dashboard queries find them. A second consumer archives the stream to S3 in large, infrequent batches.

Click any box to open its page. Open it in the playground to rewire it, change the traffic or take parts down.

Thousands of sensors each send a reading every few seconds. A stream takes that firehose without blinking and keeps it for a while, so consumers can process it at their own pace. One consumer writes readings into a time-series database for live dashboards; another archives the raw stream to cheap object storage for later analysis.

How it flows

  1. 1

    Devices append to the stream

    Each device sends readings with its id as the partition key, so one device’s readings stay in order on one shard. The stream keeps them for at least 24 hours.

  2. 2

    Lambda loads the database

    Lambda polls the stream, receives batches of records, and inserts them into a TimescaleDB hypertable that is partitioned by time behind the scenes.

  3. 3

    Dashboards query recent data

    Grafana runs time-bucketed SQL such as time_bucket('1 minute', time) against TimescaleDB every few seconds to draw live charts.

  4. 4

    The raw stream is archived

    A separate consumer reads the same stream in large batches and writes compressed files to S3, where analysts can query months of history without loading the database.

Why this shape works

  • The stream absorbs spikes and lets each consumer run at its own pace
  • Adding a consumer (alerting, ML features) doesn’t touch devices or the other consumers
  • The time-series database keeps recent data fast to query and old data compressed
  • Raw history is kept cheaply and can be replayed if processing logic changes

Where it strains

  • Shards cap throughput per partition key range; plan capacity or use on-demand mode
  • If the Lambda consumer errors on a bad record, it can block its shard until the record expires
  • Retention and downsampling policies decide how much the database grows
  • Devices on flaky networks send late or duplicate readings; design inserts to tolerate both

Common swaps

Built from

Architectures with parts in common

Sources

Improve this page on GitHub