OPC UA vs MQTT: which protocol to use for industrial data

When a plant starts collecting machine data, the same question comes up: OPC UA or MQTT? Both are open, both are widely used, and they are often presented as rivals. In practice they solve different problems and work well together.
At Timeus Lab we connect controllers to business systems every day. This guide compares the two in plain terms.
What is OPC UA?
OPC UA (Open Platform Communications Unified Architecture) is a vendor-neutral standard for exchanging industrial data with meaning attached. A server, often built into a PLC or a gateway, exposes data as a structured model: a machine with its parts, variables, units, alarms and methods. Clients browse that model and read, write or subscribe to values. Security with certificates, signing and encryption is part of the standard.
What is MQTT?
MQTT is a lightweight publish and subscribe messaging protocol. Devices publish messages to topics on a broker, and any number of clients subscribe to the topics they need. It is simple, efficient on poor networks and easy to scale. MQTT itself does not define what the data means; that is agreed by the users, for example with the Sparkplug specification for industrial payloads.
How do they compare?
| Topic | OPC UA | MQTT |
|---|---|---|
| Model | Client and server, plus publish and subscribe | Publish and subscribe through a broker |
| Data meaning | Rich information model built in | Defined by convention or Sparkplug |
| Typical place | Close to machines, PLC to SCADA and MES | From edge to servers and cloud, many consumers |
| Network load | Higher | Very low |
| Security | Certificates, signing, encryption, user rights | TLS and broker authentication |
| Discovery | Clients can browse what a server offers | Clients must know the topics |
When should you use OPC UA?
Use OPC UA close to the machines, where you need to read and write controller data with clear meaning, browse what a machine offers, and call functions such as starting a recipe. Many modern PLCs offer an OPC UA server, so no extra hardware is needed.
When should you use MQTT?
Use MQTT to move data from many sources to many consumers: from edge gateways to a historian, a data platform, dashboards and AI models. It handles unstable networks and many devices well, and new consumers can subscribe without touching the machines.
How do plants combine both?
A common pattern: an edge gateway reads PLCs over OPC UA or native protocols, gives values clear names and units, and publishes them over MQTT to a central broker. Business systems and analytics subscribe from there. Writes back to machines go through a controlled path with checks and logs. This keeps the control network protected while data flows freely above it. See our guide on industrial cybersecurity.
Questions
Can MQTT replace a fieldbus?
No. Fieldbuses such as PROFINET or EtherNet/IP handle fast, deterministic control. MQTT is for moving data to systems above the control level.
Do we need a broker in the cloud?
No. The broker can run on a server inside the plant, and only selected data can be forwarded to the cloud.
Can old machines be connected?
Yes, through gateways that translate Modbus or other protocols. See connecting legacy machines.