Advantages of MQTT protocol | disadvantages of MQTT protocol
This page covers advantages and disadvantages of MQTT protocol. It mentions benefits or advantages of MQTT and drawbacks or disadvantages of MQTT.
What is MQTT protocol?
As shown MQTT is broker based light weight protocol. In this architecture, clients communicate via broker. One or more clients and broker can communicate with each other.
MQTT runs on top of TCP/IP and hence it is connection oriented protocol. It uses publish/subscribe model for communication.
Following are the features of MQTT protocol:
• It is over TCP.
• It uses SSL/TLS for security.
• There are many messages used in MQTT protocol such as CONNECT, PUBLISH, SUBSCRIBE, DISCONNECT etc.
• Username/Password is used in "connect" message.
• It encrypts payload i.e. it is payload agnostic.
• 1883 port is used by MQTT protocol.
➨Refer MQTT Tutorial >> for more information.
Benefits or advantages of MQTT protocol
Following are the benefits or advantages of MQTT protocol:
➨The MQTT protocol payload can carry any type of data such as binary, ascii text etc. The receiver need to interpret and decode as per format used by the transmitter. Hence MQTT is packet agnostic.
➨It uses packet of low size and hence can be used for low bandwidth applications.
➨It offers lower battery power consumption.
➨It is reliable protocol as it uses QoS options to provide guaranteed delivery.
➨Due to its publish/subscribe model, It is scalable.
➨It offers de-coupled design as it is easy to decouple the device and server.
➨A publishing device can send data to server at any time regardless of its state.
Drawbacks or disadvantages of MQTT protocol
Following are the drawbacks or disadvantages of MQTT protocol:
➨MQTT uses TCP protocol which requires more processing power and more memory. TCP uses handshake protocol which requires frequent wake up and communication time intervals. This affects battery consumption. Moreover TCP connected devices tend to keep sockets open for each other which adds memory/power requirements.
➨Centralized broker limits the scalability as each client devices take up some overhead. In order to avail scalability, local broker hub is used.
➨Centralized broker can be point of failure as client connections with broker are open all the time.
➨It is not easy to implement compare to HTTP.
➨It does not support advanced features such as flow control.
➨In MQTT protocol, clients must have to support TCP/IP.