Published on

SPARKPLUG B vs OPC UA: Comparison of Communication Protocols Part II

  • avatar
    Martin Szerment


In industrial automation and the Internet of Things (IIoT), communication protocols play a crucial role in ensuring efficient data exchange between various systems and devices. Two popular protocols in this field are OPC UA and Sparkplug B. This article provides a detailed comparison of these two protocols, their architectures, data formats, and applications.

OPC UA (OPC Unified Architecture)

OPC UA is a communication protocol developed by the OPC Foundation, aimed at standardizing the exchange of data and information between different industrial automation systems. It was introduced in 2008 as a successor to the OPC Classic protocols.

A diagram illustrating a network of OPC clients and servers. Three blocks on the left labeled "OPC Client (request)" are connected by arrows to three blocks on the right labeled "OPC Server (response)." Blue arrows represent requests, and orange arrows represent responses. © HiveMQ GmbH.

Key Features of OPC UA:

  • Standardized Data Exchange
  • Data Transmission Formats
  • Client/Server Architecture
  • Protocols Used
  • Security
  • Gateway Compatibility
  • Extensive Documentation

Architecture of OPC UA: OPC UA is based on a client/server architecture and uses TCP/IP and HTTP/SOAP as foundational technologies. The OPC UA server converts hardware communication protocols so that device data is transmitted through a standard device model. The OPC UA client decides when and what data the server retrieves from the underlying systems.

A diagram illustrating the integration of various industrial devices, sensors, and protocols with SCADA, MES, Historian, Analytics, and applications. The left side shows devices and gateways, while the right side connects to software platforms, with arrows indicating the connections.

Sparkplug B

Sparkplug B is a protocol based on MQTT, developed by Arlen Nipper, one of the creators of MQTT. It addresses the needs of the industry, offering a more standardized protocol than OPC UA, but with less complexity.

Key Features of Sparkplug B:

  • Simple Implementation
  • Quality of Service (QoS)
  • Lightweight and Efficient
  • Data Independence
  • Session Continuity (Retention)
  • Centralized Data Architecture
A diagram depicting the architecture of an industrial communication system using the Sparkplug protocol. On the left side are various devices such as sensors, digital and analog inputs, OPC UA and Modbus devices, connected to three gateways and a PLC, all supporting Sparkplug. These elements connect to a central broker, which then transmits data to MES, Historian, Analytics, and other applications, also supporting Sparkplug, positioned on the right side.

Comparison of OPC UA and Sparkplug B Architectures

  • OPC UA: Client/Server Architecture, decentralized structure, protocols TCP/HTTP, and SOAP, security enhanced with TLS and certificates.
  • Sparkplug B: Based on MQTT, centralized data architecture with an MQTT broker, simple implementation and lightweight.
Table comparing the characteristics of Sparkplug B and OPC UA. The columns list various features: scalability, data integrity, efficiency, ease of integration, cloud connectivity, complexity of specification, lightweightness, and centralization. Sparkplug B is characterized by high scalability, good data integrity, high efficiency, easy integration, easy cloud connectivity, simple specification, lightweightness, and centralization. OPC UA, on the other hand, exhibits poor scalability, complex data integrity, low efficiency, complex integration, complex cloud connectivity, a complicated specification with documentation totaling 1200 pages, as well as a lack of lightweightness and centralization.

Data Format: OPC UA vs Sparkplug B

  • OPC UA: Prefers XML format but can also transmit data in JSON. Data includes headers with metadata, increasing complexity.
  • Sparkplug B: Data format lighter and more efficient without additional metadata headers.
XML vs JSON - Main Differences in Data Format

The main difference between the two protocols lies in the lack of centralization in OPC UA, which can be challenging when attempting to collect data.

Diagram comparing the network structures of MQTT/Sparkplug B and OPC UA, where MQTT/Sparkplug B has a central node, while OPC UA depicts a fully connected network.


Both protocols, OPC UA and Sparkplug B, have their unique advantages and are used in different industrial contexts. OPC UA offers a more comprehensive and secure structure, ideal for complex systems requiring high levels of security and standardization. On the other hand, Sparkplug B is lighter, simpler, and more efficient, making it an ideal choice for applications requiring low latency and ease of implementation.

Back to the blog