MQTT is an efficient messaging protocol that has gained considerable popularity in the context of Industrial IoT and Industry 4.0 applications. One of the main advantages of MQTT is its lightness, which enables efficient data transmission even in environments with limited bandwidth. The specifications of the standard can be found here.
The emergence of MQTT: From IBM to the standard in Industrial IoT
MQTT (Message Queuing Telemetry Transport) was developed in 1999 by Dr. Andy Stanford-Clark from IBM and Arlen Nipper from Cirrus Link Solutions. Originally designed to monitor oil pipelines via satellite connections, MQTT quickly became an open industry standard for the transmission of messages in connected systems. Its lightness, efficiency and ability to communicate in real time made it a fundamental technology for the Internet of Things (IoT) and Industry 4.0 applications.
MQTT minimizes bandwidth usage by moving from a conventional “poll-response” behavior (such as the OPC UA client-server architecture) to an event-based “publish-subscribe” behavior. Event-based means a data consumer waits for data changes (instead of polling it cyclically), enabling real-time, event-driven communication between devices and applications within the organization and beyond.
The advantages of MQTT
MQTT reduces integration costs, especially with a large number of data consumers and producers, as consumers can interact with any number of producers with a single connection. Wildcard subscriptions can be used to automatically recognize new data producers as soon as they become available. Further advantages of MQTT in an industrial environment are:
Lightweight data transmission:
Due to its lean protocol design, MQTT requires less bandwidth for the transmission of data. This is particularly advantageous in networks with limited capacity or high costs per data transmission.
Wireless network connectivity:
With the ability to communicate securely and reliably over wireless networks, MQTT is ideal for remote or hard-to-reach locations where wired connections are impractical.
Low consumption of resources:
MQTT is resource-efficient in terms of bandwidth, energy and memory, which makes it particularly suitable for use in microcontroller-based systems used in industrial IoT applications.
The Quality of Service (QoS) levels of MQTT enable reliable message transmission, even in networks with high latency or sporadic connectivity.
Minimal need for processing and storage resources:
The efficient coding of MQTT messages and the ability to use persistent sessions reduce the need for processing and storage resources.
Thanks to the publish-subscribe architecture, MQTT enables event-driven real-time communication, which is crucial for many industrial applications.
MQTT can be easily integrated into existing systems and networks, providing a quick way to realize Industry 4.0 capabilities without disrupting the existing infrastructure.
With its ability to reliably manage thousands of devices and messages, MQTT easily scales with the growth of your IoT solutions and applications.
MQTT in the context of Industrial IoT
In the modern factory, the seamless integration of devices and systems is paramount. In this context, MQTT has really come into its own and has become the preferred choice for many factory operators. Example applications are:
Integration of sensors: With the growing importance of the Industrial IoT, the integration of sensors in factories is a key requirement. MQTT has established itself as the leading protocol for sensor connectivity. Examples include the connection to central systems or cloud platforms via IoT gateways using WIFI or Bluetooth.
Communication across different layers: MQTT is increasingly being used as the leading communication protocol for the Enterprise and Connected World layer of the ISA95 model. The broker-based pub/sub model minimizes integration costs and increases scalability. This is particularly important in the context of architectures such as the Unified Namespace (UNS).
Unified Namespace (UNS): The UNS architecture offers a central, non-hierarchical system architecture. In this architecture, all factory data is accessible via a standardized naming convention and data structure in a central message broker. MQTT supports this approach by enabling data producers to continuously publish data in the central message broker. This follows the principle of “publish once, distribute everywhere”, which means that data can be published once and then made available to any number of systems and applications. You can find more information about UNS in our blog.
With these advantages, MQTT has not only established itself as a useful tool, but also as an integral part of the modern factory. It helps companies to optimize systems, increase throughput and ultimately produce more competitively.
MQTT or Kafka: which is better for Industrial IoT?
Both MQTT and Kafka are widely used in the world of data transmission and processing and have proven themselves in various use cases as a broker-based publish/subscribe architecture. Both technologies make it possible to transfer data between different systems or components. However, the technologies offer different focuses and functions.
What do MQTT and Kafka have in common?
Data transfer: Both enable the sending of data between producers and consumers on the basis of a message broker.
Middleware: Both Kafka and MQTT act as middleware to transport data between senders and receivers.
Distributed systems: Both technologies support distributed systems and can be implemented in environments with multiple servers and clients.
Reliability: Both Kafka and MQTT offer mechanisms to guarantee data transmission, although the implementation and guarantees are different.
What are the differences between MQTT and Kafka?
Throughput and latency:
MQTT: Offers lower latency and is ideal for use cases where fast delivery of messages is critical.
Kafka: Can process extremely high throughputs of messages and is well suited for applications involving the processing of large data streams.
MQTT: Is primarily designed to transmit messages with low latency and does not offer any built-in functions for long-term data storage.
Kafka: Provides robust data storage capabilities and can retain messages for extended periods of time (configurable) for reprocessing or referencing in the event of an error.
Fault tolerance and recovery:
MQTT: Has mechanisms for message acknowledgement, but no native support for replay or long-term storage of data for later recovery.
Kafka: Provides strong disaster recovery capabilities thanks to its persistent storage architecture and the ability to “replay” data streams.
Implementation and maintenance effort
MQTT: The implementation based on client libraries, the configuration of an MQTT broker and the management and monitoring of MQTT brokers tend to be relatively simple.
Kafka: The introduction of Kafka is significantly more complicated (e.g. in terms of the setup and configuration of the clusters, planning of hardware or cloud infrastructure). Data storage management and robust cluster management and monitoring are also much more demanding.
MQTT: Is a lightweight publish/subscribe protocol designed specifically for resource-constrained environments and is ideal for communicating with Industrial IoT devices.
Kafka: Is a distributed streaming platform designed specifically for streaming and processing large amounts of event data in real time. Kafka is excellent for big data processing, data analytics, aggregation and applications that involve processing data streams on a large scale.
The question of whether “MQTT or Kafka” can be answered based on the requirements of the use case. In order to use Kafka profitably, the scaling benefits should more than compensate for the additional implementation and maintenance costs. In practice, MQTT and Kafka are often used in complementary ways – for example, MQTT at the edge level for communication with industrial IoT devices and Kafka for processing data streams in the cloud. Both have specific strengths and can be used together to create robust, scalable and efficient industrial IoT architectures.
i-flow and MQTT: Perfect symbiosis for modern factory communication
The i-flow software offers you a wide range of options for implementing a UNS architecture and provides a UNS tailored to factories. This can be operated both standalone and in combination with your existing UNS infrastructure. i-flow comes with a fully integrated MQTT broker, but also supports existing message brokers in your architecture, such as MQTT and Kafka.
In this case, i-flow acts as a connectivity and harmonization layer for your UNS. In particular, the heterogeneity of source data can be standardized and processed using i-flow before it is published in the broker. Data and properties of factory systems and their relationships are described in so-called data models. You can use both your own and existing standards (e.g. ISA95). Based on these data models, the data is published consistently in the UNS.
In addition, OT and IT data can be combined and transformed as required. For example, if a machine only provides a time stamp at the start and end of the process instead of a cycle time, the cycle time can be calculated in i-flow and published in the UNS in a standardized way.
Try it out now - free trial version
Take a test and see for yourself the unlimited possibilities that i-flow offers. 30 days free trial, on your systems.