Head to Head,HTTP vs MQTT
#Knockout,and the winner is MQTT!
Maybe thats why Facebook Messenger uses it ;)
> HTTP is document-centric whereas MQTT is data-centric.
> MQTT transfers data as a byte array which in comparison to HTTP is lightweight and uses less bandwidth as later supports MIME standard to define the content type and constrained devices like sensors, low energy powered devices, etc. doesn’t need such advance feature.
> MQTT is a simple pub-sub messaging system which is loosely coupled, which allows client’s existence independent of any other device and is a bidirectional communication channel and on the other hand HTTP follows request/response messaging model, where client’s need to know the exact address of the device to which it connects.
> MQTT is more developer orientated protocol with less specification, methods (SUBSCRIBE,PUBLISH,CONNECT,DISCONNECT, UNSUBSCRIBE) and message types as compared to HTTP,being a complex protocol which uses methods(POST,PUT,GET,UPDATE etc.) and many return codes.
> The devices with limited computational resources in low-bandwidth network environments can leverage MQTT design which is necessary to support them, with a header of the message as short as 2 bytes in size, and the message itself is in binary format.
> HTTP will not do justice to mobile devices, sensors, etc. as it is text-oriented and consumes a lot of network bandwidth, which might be a high concern for mobile apps users to some extent and such constraint device would not desire such sophisticated protocol as HTTP, draining the battery as we all are aware of.
QUALITY OF SERVICE
> MQTT supports 3 QOS levels out of the box in message publication,which makes developers life easy as there is no requirement to write complex,additional logic to ensure message delivery.
> HTTP DO NOT HAVE ANY RETRY ABILITY OR QOS.
> HTTP is point-to-point communication,whereas MQTT has a built-in distribution mechanism,supporting one to one,one to many,one to zero distribution models
The Facebook Messenger & Instagram uses MQTT to serve millions of messages to billions of devices.
Future of mobile app communication
Stop exploiting the protocol intended for WEB (HTTP), try MQTT to make your user happy, designed for…medium.com
#revolution in M2M (machine to machine)communication,an extremely lightweight publish/subscribe messaging transport for…medium.com
P.S. Thanks for reading this far! I’d really appreciate it if you recommend this post so other people can see it!.