MQTT
Also known as: MQTT broker, MQTT 5.0, Mosquitto, Sparkplug B
MQTT (Message Queuing Telemetry Transport) is a communication protocol built for IoT.
Devices publish messages to a topic on a broker; subscribers receive messages from topics they're interested in. It's designed for low-bandwidth, high-latency connections: sensors in remote locations can send readings reliably even over satellite links.
MQTT, explained at three levels
At home
MQTT works like a message board. A temperature sensor posts its reading to 'home/bedroom/temperature'. Your smart thermostat and your phone are both subscribed to that topic: they both receive the reading instantly. The broker (server) manages who gets what.
At work
IoT devices use MQTT to send readings back to a central server. The protocol is extremely efficient: an MQTT message can be as small as 2 bytes of overhead, making it suitable for sensors with small batteries and slow network connections.
At home
MQTT's three components: Publisher (sends messages), Broker (receives and routes messages: Mosquitto, HiveMQ, AWS IoT Core), and Subscriber (receives messages on subscribed topics). Topics use slash-separated hierarchies ('factory/machine1/temperature'). Wildcards: '+' matches one level ('factory/+/temperature'), '#' matches all levels below ('factory/#').
At work
MQTT QoS (Quality of Service) levels: 0 (at most once (fire and forget), 1 (at least once) acknowledged delivery, may duplicate), 2 (exactly once: guaranteed single delivery, higher overhead). Retained messages let the broker store the last value on a topic, so new subscribers immediately get the current state. MQTT 5.0 added message expiry, user properties, and improved error reporting.
At home
MQTT uses persistent TCP connections (or TLS for security), with a small keep-alive heartbeat. The Last Will and Testament (LWT) feature lets a device register a message the broker will publish if the device disconnects unexpectedly: enabling other systems to detect failures. Clean sessions vs. persistent sessions control whether subscriptions and queued messages survive disconnections.
At work
At industrial scale, MQTT brokers handle millions of connections with horizontal clustering (HiveMQ, EMQX). Sparkplug B (built on MQTT 3.1.1) adds a structured payload schema for industrial IoT interoperability. MQTT over WebSockets enables browser clients. Bridging connects multiple MQTT brokers, allowing hierarchical architectures where edge brokers relay to cloud brokers.
Real-world examples
At home
Marcus uses MQTT with Home Assistant for his smart home. His door sensor publishes to 'home/door/front'; Home Assistant is subscribed and turns on the hallway light whenever a message arrives saying the door opened.
At work
Fatima's industrial monitoring system has 2000 sensors publishing to an MQTT broker every 5 seconds. A stream processing system subscribes to all topics and triggers alerts when readings exceed thresholds, logging all data to a time-series database.
Common confusions
- MQTT is only for simple IoT toys — MQTT powers industrial manufacturing, oil and gas monitoring, fleet tracking, and large-scale home automation. AWS IoT Core and Azure IoT Hub both use MQTT as their primary device protocol. It's a serious industrial standard.
- MQTT requires constant internet connectivity — MQTT's persistent session and QoS 1/2 levels allow devices to store and forward messages, retrying delivery when connectivity is restored. The protocol was designed for unreliable networks from the start.
For analysts
MQTT data from IoT sensors often feeds operational dashboards and analytics. BAs in manufacturing, utilities, or logistics may encounter MQTT-sourced data in time-series databases like InfluxDB or cloud IoT platforms.
History & origin
MQTT was created by Andy Stanford-Clark of IBM and Arlen Nipper in 1999, originally to monitor oil pipelines via satellite. The protocol was designed for constrained devices and unreliable networks where every byte matters. IBM published it royalty-free in 2010, and it became an OASIS standard in 2014 (MQTT 3.1.1) and 2019 (MQTT 5.0). It's now the de facto standard IoT messaging protocol, used by AWS IoT Core and Azure IoT Hub (Google retired its Cloud IoT Core service in 2023).