I have used HTTP/s based REST API for IoT application and it works well but consumes more data bandwidth and power. Also, the server resources consumed are too high for the long polling-based method. For the above reasons, I am planning to skip the RESTful API method and would like to give MQTT a try. I haven't implemented MQTT before but read enough to give t a try. The following are a few questions I would like to get a recommendation for. Also please correct me if the reason I am switching to MQTT is wrong and there are different reasons to use MQTT.

  • Device alive was detected with a long polling method previously, using MQTT it has built-in function KeepAlive which sends PINGREQ and PINGRESP packets. Is the KeepAlive method more data-hungry than the long polling method?

  • MQTT uses 3 types of QoS; Level 0: Fire and forget, Level 1: Delivered at least once (you may receive multiple times), Level 2: delivered only once (based on 4 step handshake). I want to receive the message only once(if the message is sent one time only), as duplicates can falsely trigger my application. Do I have to enable QoS 2 which is 4 step handshake and the message is sent only once or QoS 1 is fine? If Qos 1 is fine won't it affect my application at large scale when I have 1000's of devices and messages may receive multiple times? Is a 4-way handshake done every time a message is received for QoS 2? Is it comparatively slower than the REST implementation?

  • I want to update my device which was previously done by sending a binary file over HTTP, do I need to make a topic named something like update and fetch update binary from that topic or I need to implement plain HTTP client to receive a device update? I haven't seen device update over MQTT commonly used, is there some reason that approach isn't used?

  • Let's say I have billing system based data bytes transferred/received, which protocol would be suitable among MQTT and RESTFUL AP based HTTPs considering data transferred is in optimised manner.

I think the above questions may end up not up to point but would like to get recommendations for the doubt. Thank you in advance for your help.

  • consumes more data bandwidth and power ... more than what?
    – jsotola
    Aug 31 '19 at 4:16
  • Hi Alan, these are good questions but perhaps it'd be better to ask each individual bullet point as a separate post? Take a look at How to Ask to see how things work here—usually it's best to have one specific question per post, so we can answer more specifically. Feel free to put links to your other questions in for context, though. Take a look at the tour to see an example of a single specific question.
    – Aurora0001
    Aug 31 '19 at 9:37
  • Did you read about ZeroMQ? I want to introduce another fast and reliable communication. Sep 4 '19 at 4:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.