You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/blog/2026/01/opcua-vs-mqtt.md
+25-25Lines changed: 25 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,15 +12,15 @@ tags:
12
12
13
13
The question is broken.
14
14
15
-
MQTT moves messages. OPC UA defines meaning. They operate at different layers of the stack. Comparing them is like comparing TCP to JSON.
16
-
17
15
<!--more-->
18
16
19
-
Yet the debate persists. Vendors position them as competitors. Consultants bill by the confusion. Your procurement department demands a choice.
17
+
MQTT moves messages. OPC UA defines meaning. They operate at different layers of the stack. Comparing them is like comparing TCP to JSON.
18
+
19
+
Yet the debate persists. Vendors position them as competitors. Consultants bill by the complexity. Your procurement department demands a choice.
20
20
21
21
The industry knows better. OPC UA includes MQTT in its spec. Real factories use both: MQTT for telemetry, OPC UA for machine coordination. The technologies already converged.
22
22
23
-
The false choice exists because confusion is profitable.
23
+
The persistent debate exists because the distinction between their purposes remains unclear to many decision-makers.
24
24
25
25
This article explains what each does, where they differ, and how to decide based on requirements instead of marketing.
26
26
@@ -32,7 +32,7 @@ The confusion starts with category error. Asking "MQTT or OPC UA?" is like askin
32
32
33
33
MQTT is a publish-subscribe messaging protocol designed in 1999 for satellite oil pipeline monitoring. It does exactly one thing: *move small messages between devices over unreliable networks with minimal overhead.*
34
34
35
-
**The entire protocol fits on a napkin:**
35
+
**The entire protocol is remarkably compact:**
36
36
37
37
Publishers send messages to named topics. Subscribers express interest in topic patterns. A broker routes messages from publishers to matching subscribers. That's it.
-**QoS 0**: Fire and forget. Message might arrive. Might not. Zero guarantees.
48
48
-**QoS 1**: At least once delivery. Message arrives one or more times. Duplicates possible.
49
-
-**QoS 2**: Exactly once. Four-way handshake ensures single delivery. Expensive but reliable.
49
+
-**QoS 2**: Exactly once. Four-way handshake ensures single delivery. Higher overhead but reliable.
50
50
51
51
The protocol header is 2 bytes. A temperature reading with topic and payload fits in under 50 bytes. This economy matters when you're transmitting over cellular networks, paying per kilobyte, or running on battery-powered sensors.
52
52
53
53
**What MQTT doesn't provide:**
54
54
55
55
MQTT has no concept of data types. That "72.4" could be Celsius, Fahrenheit, or an error code; the protocol doesn't know or care. It doesn't validate message structure, enforce schemas, or understand relationships between data points. Topic namespaces are conventions, not specifications. `factory/line3/temp` and `factory/line3/temperature` and `line3/factory/temp` are entirely different topics with no semantic relationship.
56
56
57
-
The broker is a single point of failure unless you architect clustering separately. Security depends entirely on broker implementation; MQTT itself just transports bytes. Discovery is non-existent; subscribers must know exact topic names in advance.
57
+
The broker is a single point of failure unless you architect clustering separately. Security implementation depends on broker configuration; MQTT itself focuses on message transport. Discovery mechanisms must be implemented externally; subscribers must know exact topic names in advance or use wildcards and filter received messages.
58
58
59
-
MQTT is deliberately stupid. Stupidity at this layer is a feature, not a bug.
59
+
MQTT is deliberately minimal. This simplicity at the transport layer enables its flexibility and efficiency.
60
60
61
61
### OPC UA: The Semantic Framework
62
62
@@ -96,11 +96,11 @@ This semantic interoperability is OPC UA's primary value. Two systems can exchan
96
96
97
97
Security is integrated. Certificate-based authentication, message signing, and encryption are specification requirements, not implementation options. Every OPC UA server must support security policies.
98
98
99
-
**The tradeoff is complexity:**
99
+
**The tradeoff is implementation complexity:**
100
100
101
101
Implementing an OPC UA server requires managing an address space, handling multiple services, maintaining subscriptions, and processing security handshakes. Client libraries are measured in megabytes, not kilobytes. A simple "read a value" operation involves session establishment, service negotiation, and potentially certificate exchange.
102
102
103
-
This overhead is absurd for a battery-powered sensor reporting temperature every 30 minutes. It's appropriate for a $2M manufacturing cell where understanding that a temperature reading represents "bearing temperature on the output shaft of motor 3, measured in Celsius, with a normal operating range of 40-65°C and critical alarm at 85°C" matters.
103
+
This overhead is impractical for battery-powered sensors with infrequent reporting requirements. It's appropriate for a $2M manufacturing cell where understanding that a temperature reading represents "bearing temperature on the output shaft of motor 3, measured in Celsius, with a normal operating range of 40-65°C and critical alarm at 85°C" matters.
104
104
105
105
### The Layer Mismatch
106
106
@@ -133,51 +133,51 @@ Understanding real differences requires moving past marketing claims to examine
133
133
134
134
### Network Assumptions
135
135
136
-
MQTT assumes unreliable networks and designs around them. The protocol was literally built for satellite links where latency is measured in seconds and packet loss is expected. QoS levels give explicit control over delivery guarantees versus bandwidth cost. The persistent session feature lets devices reconnect after network interruptions and resume exactly where they left off, receiving any messages published while offline.
136
+
MQTT was designed for unreliable networks. The protocol was built for satellite links where latency is measured in seconds and packet loss is expected. QoS levels give explicit control over delivery guarantees versus bandwidth cost. The persistent session feature lets devices reconnect after network interruptions and resume exactly where they left off, receiving any messages published while offline.
137
137
138
-
OPC UA assumes reliable networks and builds on that foundation. The request-response model expects millisecond response times. Session management assumes stable connections. Historical access and complex queries make sense when networks can support them. Running OPC UA over cellular or satellite links works, but you're fighting the protocol's design assumptions.
138
+
OPC UA was designed for reliable networks and builds on that foundation. The request-response model expects millisecond response times. Session management assumes stable connections. Historical access and complex queries make sense when networks can support them. Running OPC UA over cellular or satellite links works, but you're working outside the protocol's primary design parameters.
139
139
140
140
This difference cascades into deployment patterns. MQTT excels when you're collecting data from thousands of remote assets: wind turbines, pipeline sensors, fleet vehicles. OPC UA excels when you're integrating systems within a plant where network quality is controlled and semantic understanding matters more than last-mile efficiency.
141
141
142
142
### Discovery and Configuration
143
143
144
144
Walk up to an OPC UA server with a generic client. Hit the discovery endpoint. The server returns its complete address space: every node, every relationship, every available operation. You can browse the hierarchy, inspect type definitions, and understand capabilities without reading documentation. The server is self-describing.
145
145
146
-
Point an MQTT client at a broker. You get nothing. No topic list. No schema information. No metadata. The broker doesn't know what topics exist until something publishes to them. Subscribers must know exact topic patterns in advance or use wildcards and filter everything they receive. Topic naming is pure convention with no enforcement.
146
+
An MQTT broker doesn't expose a discovery endpoint. Topic structures and available data must be known in advance or determined through external documentation. The broker doesn't know what topics exist until something publishes to them. Subscribers must know exact topic patterns in advance or use wildcards and filter everything they receive. Topic naming is pure convention with no enforcement.
147
147
148
148
This reflects philosophical differences. OPC UA optimizes for systems integration where understanding what's available matters. MQTT optimizes for data distribution where publishers and subscribers coordinate through external mechanisms: configuration files, documentation, human agreement.
149
149
150
-
In practice, MQTT deployments build discovery and schema management in separate layers. Sparkplug defines topic namespaces and birth certificates that announce available metrics. Cloud platforms provide device registries and schema repositories. These additions acknowledge that pure MQTT is insufficient for complex systems, but they're additions, not native protocol features.
150
+
In practice, MQTT deployments build discovery and schema management in separate layers. Sparkplug defines topic namespaces and birth certificates that announce available metrics. Cloud platforms provide device registries and schema repositories. These additions extend MQTT's core capabilities to address requirements in complex industrial systems.
151
151
152
152
### State and Synchronization
153
153
154
154
OPC UA maintains state. The server knows current variable values. Clients can read the current state at any time. Subscriptions detect changes and notify clients. If a client disconnects and reconnects, it can query what changed during the outage. The historical access service provides time-series queries.
155
155
156
-
MQTT is stateless. The broker routes messages but doesn't track values. If you want the current temperature, someone has to publish it after you subscribe. The "retained message" feature lets the broker store the last message per topic, but that's a single value with no history or change tracking. There's no way to query "what happened between 2PM and 3PM yesterday?"
156
+
MQTT focuses on message transport rather than state management. The broker routes messages but doesn't track values. If you want the current temperature, someone has to publish it after you subscribe. The "retained message" feature lets the broker store the last message per topic, but that's a single value with no history or change tracking. There's no way to query "what happened between 2PM and 3PM yesterday?"
157
157
158
158
This difference shapes architecture. OPC UA servers are authoritative sources of truth. MQTT systems require separate databases if historical data or current state matters. Time-series databases like InfluxDB or Timescale became standard MQTT architecture components specifically because MQTT itself doesn't retain data.
159
159
160
160
### Security Models
161
161
162
-
OPC UA bakes security into the specification. Every implementation must support certificate-based authentication and encrypted sessions. Security policies are negotiated during connection establishment. Message signing and encryption are first-class protocol features. The specification defines exactly how certificates should be managed, what cipher suites are allowed, and how security auditing works.
162
+
OPC UA integrates security into the specification. Every implementation must support certificate-based authentication and encrypted sessions. Security policies are negotiated during connection establishment. Message signing and encryption are first-class protocol features. The specification defines exactly how certificates should be managed, what cipher suites are allowed, and how security auditing works.
163
163
164
-
MQTT treats security as someone else's problem. MQTT 3.1.1 supports username/password authentication and expects TLS encryption to happen at the transport layer, but these are optional features. Securing an MQTT deployment means configuring the broker correctly, managing TLS certificates, implementing access control lists, and possibly adding an authentication service. Two MQTT brokers can have completely different security characteristics.
164
+
MQTT delegates security implementation to the broker and transport layer rather than defining it within the protocol specification. MQTT 3.1.1 supports username/password authentication and expects TLS encryption to happen at the transport layer, but these are optional features. Securing an MQTT deployment means configuring the broker correctly, managing TLS certificates, implementing access control lists, and possibly adding an authentication service. Two MQTT brokers can have completely different security characteristics.
165
165
166
-
MQTT 5.0 added enhanced authentication mechanisms, but security remains a broker implementation concern rather than a protocol guarantee. In practice, this means MQTT security varies wildly. Some deployments run wide open with no authentication. Others implement enterprise-grade security with certificate management, role-based access control, and full encryption. The protocol allows both.
166
+
MQTT 5.0 added enhanced authentication mechanisms, but security remains a broker implementation concern rather than a protocol guarantee. In practice, MQTT security depends on broker configuration and deployment choices, ranging from open development environments to enterprise-grade implementations with full authentication and encryption.
167
167
168
-
For regulated industries (pharmaceuticals, food processing, utilities) OPC UA's integrated security is often a requirement, not a preference. Compliance documentation is simpler when the protocol specification defines security rather than depending on correct broker configuration.
168
+
For regulated industries (pharmaceuticals, food processing, utilities) OPC UA's integrated security approach often simplifies compliance documentation, as the protocol specification itself defines security requirements rather than depending on correct broker configuration.
169
169
170
170
### Bandwidth and Overhead
171
171
172
172
MQTT's 2-byte header and compact binary format minimize overhead. Publishing a temperature reading consumes roughly 50 bytes including topic and payload. Over a cellular connection transmitting 10,000 readings per day, that's under 500KB. At $1 per megabyte (typical M2M cellular rates), you're paying $0.50 per device per day just for bandwidth.
173
173
174
174
OPC UA's overhead varies by transport, but even optimized binary encoding uses hundreds of bytes per value due to security handshakes, message signatures, and type information. The same 10,000 readings might consume 5-10MB. At cellular data rates, that's $5-10 per device per day.
175
175
176
-
For battery-powered remote sensors, this difference determines project feasibility. For plant-floor equipment connected via ethernet, it's irrelevant. The question isn't which protocol has less overhead; it's whether that overhead matters in your deployment.
176
+
For battery-powered remote sensors, this difference determines project feasibility. For plant-floor equipment connected via ethernet, it's less significant. The question isn't which protocol has less overhead; it's whether that overhead matters in your deployment.
177
177
178
178
### Scalability Patterns
179
179
180
-
MQTT scales horizontally through broker clustering. In distributed deployments, multiple broker instances share message routing and load. As subscriber counts grow, additional brokers can be added to the cluster. Many modern MQTT brokers support this model, enabling millions of devices to publish and subscribe reliably at scale.
180
+
MQTT scales horizontally through broker clustering. Mosquitto, EMQX, and HiveMQ all support distributed deployments where multiple broker instances share message routing. Add brokers as subscriber count grows. Millions of devices can publish to a broker cluster, and the brokers handle distribution to subscribers.
181
181
182
182
OPC UA scales through federation and aggregation. An aggregation server connects to multiple OPC UA devices, presents a unified address space, and handles client connections. Clients connect to the aggregator instead of individual devices. Adding devices means configuring the aggregator, not changing the client.
183
183
@@ -193,7 +193,7 @@ It isn't.
193
193
194
194
But UNS doesn't eliminate protocol choice. It relocates it.
195
195
196
-
Your OPC UA machines still speak OPC UA. Edge gateways consume that semantic data, translate it to MQTT Sparkplug, and publish to the UNS broker. Protocol choice happened at the edge. Your MES connects via OPC UA when it needs semantic precision, subscribes via MQTT when it just needs telemetry. Same downstream system, different protocols for different needs.
196
+
Your OPC UA machines still speak OPC UA. Edge gateways consume that semantic data, translate it to MQTT Sparkplug, and publish to the UNS broker. Protocol choice happens at the edge. Your MES connects via OPC UA when it needs semantic precision, subscribes via MQTT when it just needs telemetry. Same downstream system, different protocols for different needs.
197
197
198
198
UNS centralizes data flow. It doesn't centralize protocol decisions; those still happen at every connection point based on the same factors: semantic requirements, bandwidth constraints, scale characteristics, native support.
199
199
@@ -215,15 +215,15 @@ Do the connected systems need shared understanding of what data means? If your M
215
215
216
216
**2. Network constraints**
217
217
218
-
Let the infrastructure decide. Gigabit plant ethernet makes protocol overhead irrelevant; choose based on semantic needs. Cellular links where you pay per megabyte make the difference between MQTT's 50-byte messages and OPC UA's kilobyte handshakes a line-item cost. Satellite connections with multi-second latency need MQTT's QoS handling regardless of other factors.
218
+
Let the infrastructure decide. Gigabit plant ethernet makes protocol overhead less critical; choose based on semantic needs. Cellular links where you pay per megabyte make the difference between MQTT's 50-byte messages and OPC UA's kilobyte handshakes a line-item cost. Satellite connections with multi-second latency benefit from MQTT's QoS handling regardless of other factors.
219
219
220
220
**3. Native protocol support**
221
221
222
-
Work with your equipment, not against it. Many industrial controllers and drives expose data natively over OPC UA, while cloud IoT platforms are designed around MQTT. MQTT broker clusters scale horizontally and handle massive device counts efficiently. Forcing non-native protocols to match personal preferences creates integration work without adding real value.
222
+
Work with your equipment, not against it. Siemens PLCs, Rockwell controllers, and Schneider drives speak OPC UA natively. AWS IoT expects MQTT. HiveMQ clusters scale MQTT efficiently. Leveraging native support reduces integration complexity.
223
223
224
224
**4. Scale characteristics**
225
225
226
-
Five hundred vibration sensors streaming to cloud storage need MQTT's horizontal scaling through broker clusters. Fifty machines requiring discovered operations and validated method calls need OPC UA's self-describing address spaces. Different problems, different optimal solutions.
226
+
Five hundred vibration sensors streaming to cloud storage align with MQTT's horizontal scaling through broker clusters. Fifty machines requiring discovered operations and validated method calls align with OPC UA's self-describing address spaces. Different problems, different optimal solutions.
227
227
228
228
For example, you're connecting 50 CNC machines, 500 environmental sensors, [MES](/solutions/mes/), predictive maintenance, and cloud analytics.
0 commit comments