IBM IoT Foundation: when to use MQTT and when to use REST to send events?

The IBM IoT Foundation allows devices to send events to the IBM cloud for consumption and recording. There seem to be two main mechanisms for achieving event passing ... MQTT and REST (HTTP POST requests). Assuming the project will have sensors with direct TCP connectivity to the IBM area via the Internet, what can we consider as potential differences between the two technologies? What factors can influence the choice of MQTT or REST as the technology to use? Are there significant differences in end-mile performance at the end of IBM that say one technology is preferred over another?

+5
source share
1 answer

MQTT is designed as a quick and easy messaging protocol and, as a result, is faster and more efficient than HTTP when used to execute the equivalent. More efficient not only means less traffic data and more speed, but sometimes it can mean less electrical power. MQTT is especially good where bandwidth is a problem.

MQTT, however, needs a client implementation (e.g., Paho), which is perhaps a rarer thing than an HTTP client implementation, which will be more common and therefore more likely / readily available on any given device.

There are also considerations for a TCP / IP port where some network devices 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 that the reasons for choosing HTTP instead of MQTT will be related to network or client support.

There is no official document on performance differences yet, but it’s safe to say that MQTT will be more efficient and faster, given almost any messaging scenario (long-lived connections or adhoc, etc.).

+7
source

Source: https://habr.com/ru/post/1243255/


All Articles