Skip to main content
What is MQTT?
  1. Glossary/

What is MQTT?

7 mins·
Ben Schmidt
Author
I am going to help you build the impossible.

You are building a business that relies on hardware. Perhaps you are deploying sensors in a remote agricultural field or tracking high-value assets across a logistics network. You might simply be creating a smart home device that needs to talk to a mobile app.

In all these scenarios, you face a specific set of constraints that software-only startups often ignore.

Your devices might run on batteries.

Your internet connection might be spotty or expensive.

Your processor might be tiny and underpowered to save costs.

If you try to use standard web protocols like HTTP for these tasks, you are going to run into problems. The overhead is too high. The battery drain is too fast. The data usage will eat your margins.

This is where MQTT comes in.

MQTT stands for Message Queuing Telemetry Transport. It is a standard messaging protocol for the Internet of Things (IoT). It is designed as an extremely lightweight publish-subscribe messaging transport.

It is ideal for connecting remote devices with a small code footprint and minimal network bandwidth.

Think of it as the Twitter of the machine world. Instead of heavy conversations, it sends short, efficient bursts of information.

The Mechanics of MQTT

#

To understand how this impacts your product architecture, you need to understand the basic components. MQTT functions differently than the request-response model most of us are used to with the web.

It relies on a Publish and Subscribe model.

There are three main players in an MQTT architecture.

1. The Client

This is your device. It could be a temperature sensor, a microcontroller on a scooter, or a mobile application. Clients do not talk to each other directly. They talk to the broker.

2. The Broker

This is the server. It acts as the traffic controller or the post office. Its only job is to receive messages, filter them, and decide who needs to receive them. It handles the complexity so the devices do not have to.

3. The Topic

This is the routing information. A topic is like a channel or a subject line. It usually looks like a file path, such as house/kitchen/temperature.

Here is how the flow works in practice.

A temperature sensor (Client A) publishes a message saying “72 degrees” to the topic house/kitchen/temperature.

The Broker receives this message.

Your mobile app (Client B) has previously told the Broker, “I want to know about house/kitchen/temperature.” This is called subscribing.

The Broker sees the new message and immediately pushes it to the mobile app.

The sensor does not know the app exists. The app does not know the sensor exists. They both just know the Broker and the Topic.

This decoupling is powerful for startups. It means you can add new devices or new listeners without rewriting the code on the existing devices.

Why Startups Choose MQTT

#

There is a reason this protocol has become the standard for IoT. It addresses the physical and economic realities of hardware businesses.

Bandwidth Efficiency

Every byte of data you send costs money, especially if you are using cellular IoT plans. MQTT messages have a very small header (as little as 2 bytes). This is significantly smaller than HTTP headers.

Over millions of messages and thousands of devices, this efficiency is the difference between a profitable subscription model and a money pit.

Battery Life

Radio transmission is the biggest drain on a battery. Because MQTT keeps messages short and connections open efficiently, devices spend less time transmitting and more time sleeping.

Build for unreliable networks first.
Build for unreliable networks first.
Unreliable Networks

This is critical for real-world operations. MQTT includes a feature called “Last Will and Testament.” If a device drops off the network unexpectedly, the Broker can notify other subscribers that the device is offline.

It also handles re-connections gracefully. If a truck drives through a tunnel and loses signal, MQTT is designed to re-establish the link and send buffered data as soon as the connection returns.

Comparing MQTT and HTTP

#

Most technical founders or early hires come from a web development background. Their default tool is HTTP. This is the protocol that powers the web browser you are using right now.

It is important to know when to push back against using HTTP for your hardware.

HTTP is Request-Response

The client asks a question (request), and the server answers (response). If the server has new data, it cannot send it until the client asks again.

Imagine you are waiting for a package. HTTP is you opening the front door every ten seconds to check if the truck is there. It is exhausting and wasteful.

MQTT is Event-Driven

The server pushes data to the client the moment it arrives. Using the analogy above, MQTT is the doorbell. You sit on the couch and do nothing until the doorbell rings.

The Overhead Difference

HTTP sends a lot of metadata with every request. It tells the server what browser you are using, what languages you accept, and more. This is fine for a laptop on WiFi.

For a sensor on a coin-cell battery, that metadata is wasted energy. MQTT strips all that away.

However, HTTP is still useful in your stack. If your device needs to download a large firmware update or upload a high-resolution image, HTTP is often better suited for those large, one-time file transfers.

MQTT is for the stream of small, frequent data points.

Quality of Service Levels

#

As you plan your product, you will need to make decisions about data reliability versus speed. MQTT gives you a lever to pull here called Quality of Service (QoS).

There are three levels, and you should ask your engineering team which one they are implementing.

QoS 0: At most once

This is “fire and forget.” The device sends the message and does not wait for a receipt. If the network blips, the data is lost. This is best for data that updates frequently, like a speedometer. If you miss one reading, the next one is coming in a second.

QoS 1: At least once

The device sends the message and waits for the broker to acknowledge it. If it does not get a receipt, it resends. This guarantees the message arrives, but it might arrive twice.

QoS 2: Exactly once

This involves a four-step handshake to ensure the message arrives exactly one time. This is the slowest method but the most reliable. You use this for critical alerts, like a “fire detected” signal or a payment transaction.

Strategic Considerations

#

While MQTT is a robust standard, it introduces questions you must answer as you build your organization.

Security is not automatic

By default, basic MQTT might send data in plain text. You must implement TLS/SSL encryption. This adds to the processing load on your device. Have you accounted for that in your hardware selection?

The Central Point of Failure

Since everything goes through the Broker, the Broker becomes your most critical piece of infrastructure. If the Broker goes down, your entire fleet of devices stops communicating.

Are you managing your own Broker, or are you paying a cloud provider (like AWS IoT Core or Azure IoT Hub) to manage it for you? Managing it yourself is cheaper in direct costs but requires high engineering maintenance. Cloud providers are expensive at scale but offer high reliability.

Data Structure

MQTT does not care what the data looks like. It just transports the payload. You need to define a strict data schema. If one developer writes the date as DD/MM/YYYY and another writes it as MM/DD/YYYY, your system will break.

Who owns the data contract in your organization? Is it the firmware engineers or the cloud engineers?

These are the types of architectural decisions that determine if a hardware startup scales smoothly or drowns in technical debt. MQTT provides the lightweight rails for your data, but you still have to build the trains.