Difference between MQTT and HTTP protocols

1. Message Queuing Telemetry Transport (MQTT) :
It was created by Andy Standford-Clark and Arlen Nipper. It is an IoT interaction protocol based on the Publish/Subscribe model. This model is a simple model that provides support for QoS (Quality of Service). Due to its abilities, it can be found in every second IoT based device. This protocol has many features as it is over TCP and uses SSL/TLS for security. For messaging between server it uses CONNECT, PUBLISH, SUBSCRIBE, DISCONNECT, etc.

2. Hyper Text Transfer Protocol (HTTP) :
It is used by World Wide Web (WWW) for defining how its messages are going to be transmitted and formatted. This protocol is responsible for the action that a server has to take while sending information over the network. When a URL is being entered into the browser, this protocol sends an HTTP request to the server and then an HTTP response is sent back to the browser. This protocol is also responsible for the controlling of webpages on the World Wide Web for their formatting and representation.

Difference between MQTT and HTTP protocols :

Parameter MQTT HTTP
Abbrevation Message Queuing Telemetry Transport Hyper Text Transfer Protocol
Architecture It works on publish/subscribe model. It works on request/response model.
Complexity It has less complexity. It is more complex.
Runs over It runs over Transmission Control Protocol. It runs over User Datagram Protocol.
Protocol Design This protocol’s design is Data centric. This protocol’s design is Document centric.
Message Size The message size generated is less as it uses binary format. The message size generated is more as it uses ASCII format.
Header Size It is of 2 bytes. It is of 8 bytes.
Port Number It works on 1883 port. It works on 80 or 8080 port.
Data Security It provides data security with SSL/TLS. It does not provide security but Https is built for that.

Attention reader! Don’t stop learning now. Get hold of all the important CS Theory concepts for SDE interviews with the CS Theory Course at a student-friendly price and become industry ready.

My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.