MQTT vs. HTTP for IoT

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi everyone in today's video we are going to compare mqtt vs http and find out what is the best choice for iot let us start with mqtt mqtt is a communication protocol designed specifically for iet it has published subscribe architecture and here is how it works we have a client which is publishing data we have a broker which is at the center of each communication and we have one or more subscribers who are subscribing to data a producing client called the publisher sends a specific data point to the broker and the broker would send it to all interested subscribers and these subscribers can also be publishers themselves because we have bi-directional communication flow let us move on to http http stands for hypertext transfer protocol and was created to make documents available across the internet servers contain resources that are identified by the urls that have the basic familiar form to which http clients can make requests in an iot environment a common use of http is to allow devices to post to a resource that represents the device state on the iot service and now let us compare mqtt versus http mqtt has published subscribe architecture also called pubsub while http has request response architecture client server model key difference here is the following in client server model a client communicates directly with an end point while in the pub sub model the client that sends a message is decoupled from the client or clients that receive the messages the connection between them is handled by a broker this decoupling allows pubsub to scale better than the client server approach and easily add more consumers and producers of data common targets are topics for mqtt and uris for http the underlying protocol is the same for both technologies it is tcp ip secure connections are the same for both technologies a significant advantage of mqtt over http is client observability mqtt allows client state to be monitored via notifications when client unexpectedly disconnects which is not possible in http mqtt has asynchronous event-based messaging which means that the publisher doesn't have to wait until the consumer consumes the data because of decoupling this is a very scalable way of communication this is not the case for http where messaging is synchronous in mktt the broker can queue messages for disconnected subscribers while in http the application needs to implement message queueing message overhead is 2 bytes minimum in mqtt and 8 bytes minimum in http message size is 256 megabyte maximum in mqtt in http there is no message size limit but 256 megabyte is beyond normal use cases anyway content type for mqtt is any and for http it is text message distribution in mqtt is one-to-many and one-to-one in http mqtt provides three qualities of service and thus improves reliability while in http this has to be implemented in the application so what is better for iot mqtt or http mkdt fits many more iot scenarios than http as it was designed for the internet of things an exception http might be a valid choice to connect devices which already have an http client installed to a provider which has an http option but then only for low volume data transmission and without the option of sending control commands to the device check out mqtt essentials playlist to learn more on mqtt essentials and head to our full blog post on mqtt vs http for a more detailed technologies comparison stay tuned and see you in the next video [Music]
Info
Channel: HiveMQ
Views: 7,901
Rating: undefined out of 5
Keywords: MQTT, HTTP, MQTT vs HTTP, IoT, Internet of things, IoT messaging, IoT communication protocol
Id: 0LBD0-gIA1I
Channel Id: undefined
Length: 4min 40sec (280 seconds)
Published: Wed Aug 17 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.