Context card
MQTT vs. OPC UA: transport and meaning
What is the difference between MQTT and OPC UA?
The short answer
MQTT is a lightweight publish-subscribe protocol that moves messages through a broker; it says nothing about what the data means. OPC UA is an industrial interoperability framework with an information model, services, security and, with OPC UA PubSub, its own publish-subscribe mode. In practice they are often combined: OPC UA describes the data, MQTT carries it.
For: Technical writers and engineers documenting industrial interfaces
Key points
- MQTT is a transport: topics, a broker, quality-of-service levels — no data semantics.
- OPC UA models machines and their data as typed nodes with services such as read, write and method calls.
- OPC UA PubSub can use MQTT as a transport, so the two are not strict alternatives.
- Access rights, logging and write permissions decide what an application may change — the protocol alone does not.
The context
Two different layers
MQTT is a publish-subscribe protocol: clients publish messages to topics, a message broker forwards them to every subscriber. The payload is opaque to the protocol — a temperature, a JSON document or an image are all just bytes.
OPC UA starts from meaning. A server exposes an information model: objects, variables, methods and types that describe a machine. Clients browse that model, read and write values and call methods — each operation checked against the user's rights.
Why they are combined
With OPC UA PubSub, OPC UA data sets can be published over MQTT. The information model travels with the data, while the broker handles distribution to many consumers, for example cloud services or analytics.
What it means for documentation
Document for each interface who may read and write which value, which topics or nodes exist and what a message triggers. A protocol name alone does not tell a reader whether a message is a report or a command.
Questions readers ask next
- Is MQTT a replacement for OPC UA?
- No. MQTT transports messages; OPC UA defines what the data means and how it may be accessed. Many architectures use both.
- Does OPC UA need a broker?
- Client-server OPC UA does not. OPC UA PubSub can run brokerless over UDP or through a broker such as MQTT.
Sources
- MQTT Version 5.0 — OASIS, 7 March 2019
- Unified Architecture — OPC Foundation
Review log and changes
Every context card is checked against its sources before it is published, and again whenever it changes; the date under the byline is the last review. Corrections (something was wrong) and additions (something was missing) are logged below with date and time (Berlin time). Typos, formatting and link fixes are not listed.
Reviewed
No corrections or additions since publication.