Skip to content
Tutorials Center
My learning

Topics

Lesson 30 of 36 ยท Platforms and Applications

Cloud IoT Platforms and Architecture

Compare IoT platforms and learn their common building blocks: device registry, message broker, rules engine, jobs and storage. Run a rules-engine simulator.

Once you have more than a handful of devices, the broker alone is not enough. You need to register devices, give each one an identity, route and transform messages, store history, send commands and updates to groups, and see which devices are healthy. An IoT platform bundles those jobs. You can rent one from a cloud provider or run an open-source one yourself.

What every platform provides

Platform building blocks

Device registry Identity, credentials, metadata
Message broker MQTT and HTTPS endpoints
Rules engine Filter, transform, route
Fleet management Jobs, OTA, groups, monitoring

Plus storage, analytics and APIs

1 / 2
flowchart LR
  D["Devices"] -- "MQTT / HTTPS" --> E["Platform endpoint<br/>auth + ACL"]
  E --> R["Rules engine"]
  R --> S[("Time-series DB")]
  R --> F["Function / queue"]
  R --> N["Alerts"]
  E --> T["Device twin / shadow"]
  App["Apps and dashboards"] --> T
  App --> S

The endpoint authenticates; the rules engine fans messages out to the services you configure.

The main options

Platform Type Highlights
AWS IoT Core managed MQTT 3.1.1/5 broker, X.509 per device, rules in an SQL dialect, Device Shadow, Jobs, Greengrass at the edge
Azure IoT Hub (+ Device Provisioning Service) managed AMQP/MQTT/HTTPS, device twins, direct methods, IoT Edge, message routing
Google Cloud partner-based Google retired Cloud IoT Core in 2023; today you run an MQTT broker yourself or use partner services with Pub/Sub and BigQuery
ThingsBoard open source devices, dashboards, rule chains, multi-tenant
Eclipse Mosquitto / EMQX / HiveMQ brokers self-hosted MQTT, clustering (EMQX, HiveMQ)
Node-RED open source visual flow programming, great for prototypes
Home Assistant open source home automation hub with MQTT and Zigbee integrations
Vendor clouds (Particle, Blynk, Arduino Cloud) managed, device-focused easy onboarding for specific hardware

Services change quickly, so check the current documentation. The concepts stay the same.

Choosing

  • Prototype or hobby: Node-RED, Home Assistant, Arduino Cloud or a free-tier cloud broker.
  • Product with thousands of devices: a managed platform (per-message pricing, no servers to run) or EMQX/HiveMQ clusters.
  • Strict data control or air-gapped site: self-hosted open source on your own hardware.
  • Avoid lock-in: use standard MQTT and open payload formats; keep platform-specific logic in a thin layer.

The rules engine

The heart of a platform is the rules engine: you declare, for messages matching a topic and a condition, what to do. AWS IoT Core expresses rules in an SQL-like form (read-only):

SQL
SELECT topic(2) AS device, temperature, timestamp() AS ts
FROM 'plant/+/state'
WHERE temperature > 80

with an action such as "write to DynamoDB", "invoke a Lambda function", "publish to another topic" or "send an SNS notification". The program below is a small rules engine so you can see how the pieces fit: a topic filter, a condition and an action.

Node.js A tiny IoT rules engine

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with node:readline or process.stdin), it gets the next line from this box.

The overheat rule fires only for the 91 degree message on a state topic; the archive rule saves every valid message. Real engines add retries, error destinations and per-action IAM permissions.

Device provisioning at scale

You cannot hand-register 100,000 devices. Common flows:

  1. Factory provisioning: a unique certificate is injected at manufacturing and pre-registered.
  2. Fleet provisioning / DPS (Device Provisioning Service): the device connects with a bootstrap claim certificate or a hardware identity, and the platform issues its real identity on first boot.
  3. Bring your own certificate signed by your CA, with registration on first connect.

After registration the platform tracks connectivity state (connected/disconnected events), which is built on the Last Will and keep-alive ideas.

A read-only example of sending a message with the AWS SDK for JavaScript (needs AWS credentials, so it cannot run in the editor):

JavaScript
import { IoTDataPlaneClient, PublishCommand } from "@aws-sdk/client-iot-data-plane";

const client = new IoTDataPlaneClient({ region: "eu-central-1" });
await client.send(new PublishCommand({
  topic: "plant/pump-1/set",
  payload: Buffer.from(JSON.stringify({ speed: 40 })),
  qos: 1,
}));

Cost and limits

Managed platforms bill by connection minutes, messages (often counted in 5 KB blocks), rule actions and storage. Chatty devices become expensive: a device publishing every second makes 2.6 million messages per month. Combine the edge filtering ideas with batching (send ten readings in one message) to cut cost. Know the quotas: maximum payload size, publish rate per connection, number of subscriptions per client.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What does a rules engine do?

    It matches topics and conditions and then routes or transforms messages without custom servers.
  2. 2. Which approach avoids platform lock-in?

    Standards-based messaging makes it feasible to move to another broker or provider.
  3. 3. Why is fleet provisioning needed?

    Automated flows issue each device its own identity on first boot.
  4. 4. A device sends one message per second. Roughly how many messages is that per 30-day month?

    86,400 seconds per day times 30 days is about 2.6 million, which is why batching and filtering matter.

Summary

  • IoT platforms provide a device registry, message endpoint, rules engine, twins/shadows, jobs and monitoring.
  • Choose managed, self-hosted or hobby tools by scale, data control and cost; stay on standard MQTT to keep options open.
  • The rules engine is topic filter plus condition plus action.
  • Automate provisioning and watch message-based pricing and quotas.

Next: Device Twins and Shadows