In this post
MQTT
A lightweight publish/subscribe protocol that runs over TCP and routes messages through a broker. It offers three delivery levels (at most once, at least once, exactly once) and suits many devices sending small messages on unreliable links.
HTTP
The web’s request/response protocol. Universally supported and easy to debug, but heavier for tiny devices and not designed for pushing messages to them.
CoAP
A protocol modelled on HTTP but built for constrained devices and networks, running over UDP. It keeps the familiar request/response style with a much smaller footprint.
Choosing
- Many devices, small frequent messages, need to push to devices: MQTT.
- Existing web infrastructure and larger, less frequent exchanges: HTTP.
- Very constrained devices and lossy networks: CoAP.
- Whichever you choose, secure it with TLS or DTLS and authenticate devices.
Sources and further reading
- OASIS. MQTT Version 5.0. docs.oasis-open.org/mqtt/mqtt/v5.0/.
- IETF RFC 7252. The Constrained Application Protocol (CoAP). rfc-editor.org/rfc/rfc7252.
IICTP is a new independent credential and is not ISO/IEC 17024 accredited.