When to use MQTT and when to use REST for event submission

0 votes
The IBM IoT Foundation allows devices to submit events to the IBM cloud for consumption and recording. There appear to be two primary mechanisms to achieve the transmission of events ... MQTT and REST (HTTP POST requests). Assuming that a project will have sensors with direct TCP connectivity to IBM cloud over the Internet, what might we consider as the potential distinctions between the two technologies? What factors would cause us to choose MQTT or REST as the technology to use? Are there any substantial performance differences at the final mile at the IBM end that would say that one technology is preferred over another?
Sep 14, 2018 in IoT (Internet of Things) by Annie97
• 2,160 points
1,523 views

1 answer to this question.

0 votes
MQTT is designed to be a fast and lightweight messaging protocol, and is as a result, faster and more efficient at this than HTTP when used to do the equivalent. More efficient not only means less traffic data and more speed, but sometimes it can mean less electrical power as well. MQTT is particularly good where bandwidth is a concern.

MQTT does, however, need a client implementation (like Paho) which is possibly a rarer thing than an HTTP client implementation, which would be more ubiquitous and therefore more likely/easily available on any given device.

There are also TCP/IP port considerations, where some network hardware may require HTTP ports 80 or 443 (although IoTF supports MQTT and MQTTWS on port 443).

There may also be an ideological or philosophical reason for choosing HTTP instead of MQTT (or COAP for that matter), but usually, I would say the reasons for choosing HTTP instead of MQTT would be network related or client support related.

There is no official paper on the performance differences yet, but safe to say MQTT will be more efficient and faster given just about any messaging scenario (long lived connections or adhoc etc.)
answered Sep 14, 2018 by Upasana
• 8,620 points

Related Questions In IoT (Internet of Things)

0 votes
1 answer

Azure - What service to use for Arduino data (iot)

That's because the two services do completely ...READ MORE

answered Aug 1, 2018 in IoT (Internet of Things) by anonymous2
• 4,240 points
1,073 views
0 votes
1 answer
0 votes
1 answer

Is it possible to use .Net for the ESP8266?

You could write a C# marshaller, but ...READ MORE

answered Nov 19, 2018 in IoT (Internet of Things) by nirvana
• 3,130 points
2,572 views
0 votes
0 answers

Can anyone tell me how to used SSL/LTS for mqtt

Using paho mqtt stack to add encrypted ...READ MORE

Jan 31, 2019 in IoT (Internet of Things) by @Babu99
1,348 views
0 votes
1 answer

MQTT protocol connection error

Ok so you need two libraries to ...READ MORE

answered Jul 6, 2018 in IoT (Internet of Things) by anonymous2
• 4,240 points

reshown Jul 6, 2018 by Vardhan 3,098 views
0 votes
1 answer

Mosquitto 1.4.2 Websocket support

down vote In the dir mosquitto-1.4.X edit the ...READ MORE

answered Jul 9, 2018 in IoT (Internet of Things) by anonymous2
• 4,240 points
1,453 views
0 votes
1 answer

IoT request response protocol

Based on your requirement of a light ...READ MORE

answered Jul 13, 2018 in IoT (Internet of Things) by anonymous2
• 4,240 points
1,865 views
0 votes
1 answer

What is the maximum message length for a MQTT broker?

It's not entirely clear what you're asking ...READ MORE

answered Jul 17, 2018 in IoT (Internet of Things) by anonymous2
• 4,240 points
9,483 views
0 votes
1 answer

Difference between MQTT and Apache- kafka

MQTT is a standard protocol (with many ...READ MORE

answered Aug 31, 2018 in IoT (Internet of Things) by Upasana
• 8,620 points
2,214 views
0 votes
1 answer

comparision between OPC UA protocol and MQTT protocol

This is the first time I'm seeing ...READ MORE

answered Sep 4, 2018 in IoT (Internet of Things) by Upasana
• 8,620 points
3,346 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP