Home Blog Digital Twins IoB and Smart MQTT vs OPC-UA vs Sparkplug B for IIoT comparison
Digital Twins IoB and Smart March 5, 2026 8 min read

MQTT vs OPC-UA vs Sparkplug B for IIoT comparison

Digital Twins IoB and Smart Enterprise Guide 2026 SCALE D2C D2C Technology Digital Twins IoB and Smart Enterprise Guide 2026 SCALE D2C D2C Technology

Choosing the right IIoT messaging protocol is one of the most consequential decisions in an industrial digitalisation programme. MQTT, OPC-UA, and Sparkplug B each solve different parts of the connectivity problem — and using the wrong one for a given layer of your architecture creates integration debt that compounds over years of deployment.

Protocol Overview

The IIoT protocol landscape is dominated by three standards that serve different architectural roles: MQTT provides lightweight publish-subscribe messaging ideal for device-to-cloud communication; OPC-UA provides rich semantic data modelling and bidirectional communication for shop floor integration; and Sparkplug B (built on MQTT) adds industrial structure and state management to address MQTT's raw limitations in manufacturing contexts.

1999
MQTT originally designed (standardised as OASIS MQTT 3.1.1 in 2014)
2008
OPC-UA first published (IEC 62541); latest version 1.05 in 2022
2016
Sparkplug specification first published by Cirrus Link; now Eclipse Sparkplug

MQTT: The Connectivity Workhorse

MQTT (Message Queuing Telemetry Transport) is a lightweight publish-subscribe protocol designed for constrained devices and unreliable networks. It operates on a broker model: devices publish messages to topics on a central broker (Mosquitto, EMQX, HiveMQ, or cloud brokers like AWS IoT Core), and subscribers receive all messages matching their topic filters.

MQTT Strengths
Extremely lightweight (fixed header = 2 bytes), designed for low-bandwidth and high-latency networks, supports QoS 0/1/2 for different reliability requirements, wildcard topic subscriptions, Last Will and Testament for device disconnection detection, and massive broker scalability (millions of connections).
⚠️
MQTT Limitations
No semantic data model — payloads are opaque byte arrays; no standardised topic structure; no device state management; no data type information; no security built into the protocol (relies on TLS); and publishers and subscribers are tightly coupled to agreed topic structures.

MQTT's lack of a semantic layer is its primary limitation for industrial applications. Two devices publishing temperature data on different topics with different payload formats require custom integration code. This is the problem Sparkplug B was designed to solve.

OPC-UA: The Industrial Interoperability Standard

OPC-UA (OPC Unified Architecture) is far more than a messaging protocol — it is a complete platform-independent framework for industrial data exchange with a built-in semantic information model. Unlike MQTT, OPC-UA clients can browse an OPC-UA server's address space and understand the data structure, types, and relationships without prior configuration.

OPC-UA's client-server model makes it ideal for direct device communication: a SCADA system reads a PLC's OPC-UA server to get current values, call methods to control actuators, and subscribe to data changes. OPC-UA Pub/Sub extends this to broker-based messaging over MQTT or AMQP, enabling OPC-UA's semantic richness to be combined with MQTT's broker infrastructure.

Sparkplug B: Industrial MQTT

Sparkplug B (Eclipse Sparkplug) adds four critical capabilities on top of MQTT that address its industrial limitations:

Sparkplug B FeatureWhat It SolvesHow It Works
Standardised Topic NamespaceNo agreed topic structure in raw MQTTMandated format: spBv1.0/GroupID/MessageType/EdgeNodeID/DeviceID
Birth/Death CertificatesNo device state management in MQTTNBIRTH/NDEATH/DBIRTH/DDEATH messages track device online/offline state
Protobuf Payload EncodingOpaque payloads in raw MQTTStandardised Protobuf schema with name, value, datatype, timestamp, quality
State Management via SCADA HostNo system-level state in MQTTPrimary SCADA host publishes STATE messages; edge nodes resubmit data on host reconnect

Sparkplug B essentially makes MQTT behave like a well-structured industrial protocol while retaining MQTT's broker infrastructure, scalability, and ecosystem. Any Sparkplug-compliant device can be understood by any Sparkplug-compliant system without custom integration — comparable to OPC-UA's semantic model benefit, but using MQTT brokers rather than OPC-UA servers.

Protocol Comparison Matrix

DimensionMQTTOPC-UA (Client-Server)Sparkplug B
Protocol TypePublish-SubscribeClient-Server + Pub/SubPublish-Subscribe (MQTT-based)
TransportTCP/IPTCP/IP, HTTPSTCP/IP (via MQTT broker)
Semantic Data ModelNoneRich (OPC-UA information model)Moderate (typed, named metrics)
Bidirectional CommandsVia topic subscriptionNative method calls, write operationsNCMD/DCMD messages
Device State ManagementBasic (LWT only)Session-basedBirth/Death certificates + STATE
Data TypesNone (opaque bytes)Rich (70+ built-in types)Typed metrics (Protobuf)
ScalabilityVery high (millions of devices)Moderate (session-based connections)High (broker-based)
Best LayerDevice → Cloud at scalePLC/SCADA integrationEdge → SCADA/MES

Recommended Architecture Pattern

The most effective IIoT architectures use all three protocols at different layers, with each playing to its strengths:

L1
Field Layer: OPC-UA (Client-Server)
PLC and machine OPC-UA servers ↔ OPC-UA client on edge gateway. Bidirectional communication, method calls for control, semantic browsing for auto-discovery of machine data.
L2
Edge to SCADA: Sparkplug B over MQTT
Edge gateway publishes machine data as Sparkplug B metrics to MQTT broker. SCADA/MES subscribes to Sparkplug topics for process data, alarms, and device state. Standardised structure enables multiple SCADA systems to consume the same edge data.
L3
Edge to Cloud: MQTT or OPC-UA Pub/Sub
Edge gateway publishes selected data to cloud MQTT broker (AWS IoT Core, Azure IoT Hub) for cloud analytics, digital twin, and MES integration. OPC-UA Pub/Sub over MQTT preserves semantic richness for cloud digital twin platforms.

Frequently Asked Questions

MQTT is a lightweight publish-subscribe protocol designed for constrained devices and unreliable networks. It's popular for IIoT because it is extremely lightweight (2-byte fixed header), works over TCP/IP with TLS, supports millions of simultaneous device connections on cloud brokers, handles intermittent connectivity well via QoS levels and Last Will and Testament messages, and has a large ecosystem of brokers (Mosquitto, EMQX, HiveMQ) and cloud integrations (AWS IoT Core, Azure IoT Hub). Its main limitation is the lack of semantic structure — payloads are opaque, and topic naming is unstandard unless combined with Sparkplug B.

Sparkplug B (Eclipse Sparkplug specification) adds four critical capabilities to MQTT that raw MQTT lacks: a standardised topic namespace (GroupID/MessageType/EdgeNodeID/DeviceID), device state management via Birth and Death certificate messages (NBIRTH/NDEATH/DBIRTH/DDEATH), typed metric payloads using Protobuf encoding (each metric has a name, value, datatype, timestamp, and quality), and system-level state management via SCADA HOST STATE messages. Together, these additions make MQTT behave like a structured industrial protocol while retaining MQTT's broker infrastructure, scalability, and ecosystem.

Use OPC-UA Client-Server when you need bidirectional communication with industrial machines — reading current values, writing setpoints, calling control methods, and browsing the machine's data model for auto-discovery. OPC-UA is the standard for direct PLC/SCADA integration. Use MQTT (ideally Sparkplug B) when you need to aggregate data from many devices, publish to multiple consumers, scale to hundreds or thousands of devices, or integrate with cloud IoT platforms. The most effective architectures use both: OPC-UA at the field level (PLC ↔ edge gateway) and MQTT/Sparkplug B at the plant-to-enterprise level (edge gateway ↔ SCADA/cloud).

Sparkplug B defines a mandatory topic namespace: spBv1.0/[GroupID]/[MessageType]/[EdgeNodeID]/[DeviceID]. GroupID groups related edge nodes (e.g. by factory or production line). MessageType identifies the message purpose (NBIRTH, NDEATH, NDATA, NCMD for edge node messages; DBIRTH, DDEATH, DDATA, DCMD for device messages; STATE for SCADA host state). EdgeNodeID identifies the Sparkplug Edge Node (typically the edge gateway). DeviceID identifies a specific device connected to the edge node. This standardised structure allows any Sparkplug-compliant SCADA or analytics platform to correctly interpret messages from any Sparkplug-compliant device.

For plant-level (on-premises) MQTT brokers: EMQX Enterprise and HiveMQ offer the best Sparkplug B support, clustering for high availability, and enterprise security features including RBAC, audit logging, and TLS mutual authentication. Mosquitto is suitable for smaller deployments and edge broker roles. For cloud-based MQTT: AWS IoT Core, Azure IoT Hub, and Google Cloud IoT Core provide managed MQTT infrastructure with deep integration into their respective cloud analytics services. HiveMQ Cloud offers a managed MQTT broker with strong Sparkplug support for teams that want MQTT broker SLA without cloud lock-in.

OPC-UA Pub/Sub (Part 14 of the OPC-UA specification) extends OPC-UA's communication model with a publish-subscribe pattern that can use MQTT or AMQP as its transport layer. It allows OPC-UA's semantic information model — with typed nodes, engineering units, and relationships — to be published to an MQTT broker in either JSON or binary (UADP) format. This combination gives you MQTT's scalability and broker ecosystem with OPC-UA's semantic richness. Cloud platforms like AWS IoT SiteWise and Azure Digital Twins support OPC-UA Pub/Sub over MQTT as a preferred data ingestion path for digital twin scenarios.

Sparkplug B's Birth certificate mechanism ensures data consistency on reconnection. When an edge node connects or reconnects, it publishes an NBIRTH (Node Birth) message containing the complete current state of all metrics — not just changes. If a SCADA host was offline during the disconnection and misses NDATA messages, it receives the complete current state in the NBIRTH when connectivity resumes. The SCADA host's STATE message handles the reverse: when the SCADA host reconnects, it publishes its ONLINE state, which triggers all edge nodes to re-publish their NBIRTH messages, ensuring the SCADA system has a complete, consistent view of all connected devices.

For cloud IoT platform connectivity, MQTT is the dominant protocol — all major cloud IoT platforms (AWS IoT Core, Azure IoT Hub, Google Cloud IoT Core) support MQTT natively. For structured industrial data that needs semantic richness in the cloud, OPC-UA Pub/Sub over MQTT is increasingly supported, particularly by AWS IoT SiteWise (which has native OPC-UA ingestion) and Azure Digital Twins (which integrates with the Azure IoT Edge OPC Publisher module). Sparkplug B is well-supported by industrial IoT platforms like Ignition SCADA, Inductive Automation's cloud offerings, and HiveMQ Cloud, but less natively supported by general-purpose cloud IoT platforms compared to raw MQTT.

MQTT VS OP

Ready to Implement MQTT vs OPC-UA vs Sparkplug B for IIoT comparison?

Our specialist team delivers measurable ROI from Digital Twins IoB and Smart programmes for enterprise and D2C brands.

Free Audit