Skip to content

Commit b6b99a0

Browse files
Update opcua-vs-mqtt.md
1 parent b5b1af2 commit b6b99a0

1 file changed

Lines changed: 25 additions & 25 deletions

File tree

src/blog/2026/01/opcua-vs-mqtt.md

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ tags:
1212

1313
The question is broken.
1414

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-
1715
<!--more-->
1816

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.
2020

2121
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.
2222

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.
2424

2525
This article explains what each does, where they differ, and how to decide based on requirements instead of marketing.
2626

@@ -32,7 +32,7 @@ The confusion starts with category error. Asking "MQTT or OPC UA?" is like askin
3232

3333
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.*
3434

35-
**The entire protocol fits on a napkin:**
35+
**The entire protocol is remarkably compact:**
3636

3737
Publishers send messages to named topics. Subscribers express interest in topic patterns. A broker routes messages from publishers to matching subscribers. That's it.
3838

@@ -46,17 +46,17 @@ MQTT's three quality-of-service levels handle network reality:
4646

4747
- **QoS 0**: Fire and forget. Message might arrive. Might not. Zero guarantees.
4848
- **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.
5050

5151
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.
5252

5353
**What MQTT doesn't provide:**
5454

5555
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.
5656

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.
5858

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.
6060

6161
### OPC UA: The Semantic Framework
6262

@@ -96,11 +96,11 @@ This semantic interoperability is OPC UA's primary value. Two systems can exchan
9696

9797
Security is integrated. Certificate-based authentication, message signing, and encryption are specification requirements, not implementation options. Every OPC UA server must support security policies.
9898

99-
**The tradeoff is complexity:**
99+
**The tradeoff is implementation complexity:**
100100

101101
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.
102102

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.
104104

105105
### The Layer Mismatch
106106

@@ -133,51 +133,51 @@ Understanding real differences requires moving past marketing claims to examine
133133

134134
### Network Assumptions
135135

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.
137137

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.
139139

140140
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.
141141

142142
### Discovery and Configuration
143143

144144
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.
145145

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.
147147

148148
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.
149149

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.
151151

152152
### State and Synchronization
153153

154154
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.
155155

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?"
157157

158158
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.
159159

160160
### Security Models
161161

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.
163163

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.
165165

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.
167167

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.
169169

170170
### Bandwidth and Overhead
171171

172172
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.
173173

174174
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.
175175

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.
177177

178178
### Scalability Patterns
179179

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.
181181

182182
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.
183183

@@ -193,7 +193,7 @@ It isn't.
193193

194194
But UNS doesn't eliminate protocol choice. It relocates it.
195195

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.
197197

198198
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.
199199

@@ -215,15 +215,15 @@ Do the connected systems need shared understanding of what data means? If your M
215215

216216
**2. Network constraints**
217217

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.
219219

220220
**3. Native protocol support**
221221

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.
223223

224224
**4. Scale characteristics**
225225

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.
227227

228228
For example, you're connecting 50 CNC machines, 500 environmental sensors, [MES](/solutions/mes/), predictive maintenance, and cloud analytics.
229229

0 commit comments

Comments
 (0)