Between geographically dispersed devices, constrained network parameters, and the sheer number of systems that we need to link together in a full-fledged IoT solution, few things are more important than the right communication protocol.
That’s why Very uses MQTT as our IoT messaging protocol of choice.
Benefits of MQTT
Originally developed by IBM for communicating between oil pipelines and satellites, in recent years the MQTT protocol has become the de-facto standard for IoT messaging for a few reasons.
First, it’s lightweight and efficient. Second, it’s easy to scale up. Third, it’s reliable, even over unreliable networks.
Pub/Sub in MQTT
A key concept in MQTT is the publish/subscribe model, AKA pub/sub. This means that clients, such as individual devices or gateways, publish their data to a centralized MQTT broker like Eclipse Mosquitto or AWS IoT Core.
The broker then sends that data to subscribed clients, depending on the data’s “topic”. For example, if a thermometer publishes the temperature, then a mobile app, a cloud database, and a smart thermostat could subscribe to that topic, causing the broker to send it their way once it receives the data.
Other useful MQTT features include quality of service (QoS), which gives a client the ability to choose a service level befitting the network’s reliability and application logic; retained messages, which give newly-subscribed clients an immediate status update after subscribing to a topic; and the Last Will and Testament feature, which automatically publishes a message if a client suddenly disconnects due to causes such as mechanical or network failure.
Besides MQTT, IoT solutions sometimes use HTTPS, the same protocol that fuels the internet by sending document-centric data between web browsers and web sites.
While HTTPS doesn’t have all the IoT-specific benefits of MQTT and testing shows that it’s 22% less energy efficient and 15% slower than MQTT, it often works for user-facing applications like web UIs and mobile apps.
A complete IoT solution bears more resemblance to a community than a standalone product. Each member brings their own strengths to the table, excelling at certain tasks and depending on other members in turn.
Our cloud service, for instance, has exponentially more resources than an IoT device, allowing it to crunch big data sets and create valuable insights, but it relies on that device to generate data in the first place and then put its derived knowledge into practice.
That’s why connectivity is so crucial. By facilitating data flow between every corner of an IoT ecosystem, a robust connectivity framework brings the community together to achieve great things.
This concludes our “How IoT Works” series. Are you eager to learn more about how Very turns ambitious visions into reality? Check out our guide to IoT frameworks and best practices.