MQTT Overview

Overview of a typical MQTT setup for scaling device connections

MQTT is a lightweight publish/subscribe messaging transport which is widely used in the world of IoT. At it's core is a broker which handles messages bidirectionally based on topic subscriptions which makes it great for getting messages to fleets of devices, but requires thoughtful system design to handle messages from device to server in a distributed, multi-node setup.

Below is a generalized diagram for a typical design to handle such a setup using AWS IoT Core and SQS services. It showcases a common pattern of server->device->server communication where a server published message may eventually receive a message from device

Helpful tips

  • Topics help indicate direction of messages (server->device or device->server)

  • Message ingestion can be a bottle neck. Using a rules engine to look at the incoming topic and forward it to a queue allows servers to pull unique messages from the queue when available to do work.

  • MQTT is asynchronous in nature and not a request/response structure. Though it is common to design topics and messages as a "request" or "response" in behavior.

  • The server that sends a message may not be the server that handles an expected message in response

Last updated

Was this helpful?