MQTT vs REST | Difference between MQTT and REST Protocols

This page compares MQTT vs REST and mentions difference between MQTT and REST protocols.

MQTT Protocol

Broker based MQTT protocol

The figure-1 depicts MQTT architecture. MQTT is the short form of Message Queue Telemetry Transport. As shown it consists of centralized broker where in all communications between end devices go through the broker. The broker can be installed on any public server. MQTT is based on publish/subscribe architecture, where in each end devices can publish topic as well as they can subscribe for any topic. It is built on TCP protocol. Here connection is established before the communication. In MQTT protocol, Username and password is needed to establish the connection.
Refer MQTT Protocol>> for more information.

REST Protocol

REST protocol

The figure-2 depicts REST protocol stack. REST is the short form of Representational State Transfer. As shown it is built on HTTP/TCP layers. The REST protocol uses bus based architecture, where in no broker component is needed and end devices can communicate directly. In this request and response messages are used between end devices to exchange the information.

Following table mentions comparison between MQTT and REST protocols.


Features MQTT REST
Full Form Message Queue Telemetry Transport Representational State Transfer
Messages used Connect, connect ack, publish, publish ack, subscribe, subscribe ack, disconnect etc. GET, PUT, POST and DELETE
Architecture Publish/Subscribe Request/Response
Need of centralized broker required, end devices communicate via broker not required, end devices direct communicate
Transport protocol TCP/IP TCP/IP
Security protocol TLS HTTPS
fault tolerance broker in SPoF server in SPoF
Interoperability foundational semantic
scope device to cloud
cloud to cloud
device to cloud
cloud to cloud

IoT Wireless Technologies

WLAN    ➤THREAD    ➤EnOcean    ➤LoRa    ➤SIGFOX    ➤WHDI   
Zigbee   ➤6LoWPAN   ➤Zigbee RF4CE   ➤Z-Wave   ➤NFC   ➤RFID   ➤INSTEON  

What is difference between

Difference between OSI and TCPIP layers  Difference between TCP UDP  FTP vs HTTP   FTP vs SMTP   FTP vs TFTP   ARP vs RARP   NAT vs PAT   RIP vs OSPF  SLIP vs PPP  IMAP4 vs POP3  IPV4 vs IPV6 

RF and Wireless Terminologies