Should I use the AWS IoT Device SDKs or other MQTT Clients?

3 minute read
Content level: Intermediate

AWS IoT customers frequently ask for guidance around whether they should use the AWS IoT Device SDKs or other open source alternatives when building their IoT applications

AWS IoT Device SDKs are open-source libraries built for C, C++, Python, Javascript, and Java, as well as mobile SDKs for Android and iOS. There are two major versions of the SDKs, v1 and v2, and the v1 Device SDKs are no longer under active development. The v2 Device SDKs are preferred for new projects.

Underlying the v2 Device SDKs are a common set of libraries called the AWS Common Runtime, or CRT, including the s2n and aws-c-mqtt libraries. The CRT libraries are written to be cross-platform, high-performance, secure, and reliable. The s2n library was released in 2015 as an open-source implementation of the TLS encryption protocol, is simple, small, fast, and with security as a priority. Built on top of CRT, Device SDKs provide functionality that is commonly required when building IoT applications such as automatic connection retry with exponential backoff.

Additionally the Device SDKs contain programmatic abstractions to interact with AWS IoT service features including using Device Shadows and Jobs. AWS customers can get help from AWS Support when using the AWS IoT Device SDKs in their IoT applications. It is also worth noting that the Device SDKs can be used to connect to other standards compliant MQTT brokers.

The Device SDKs are not required to connect devices or applications to AWS IoT services, however they provide a number of features that help accelerate development and they help customers by providing best practices implemented by the Device SDK. Customers may choose to use an MQTT compliant open source client library, but when selecting an MQTT library they need to ensure that they are implementing all of the best practices in the AWS Well-Architected Framework.

If customers decide to bring their own MQTT client and still wish to use AWS IoT functionality such as Device Shadows and Jobs, they will have to implement interfaces to these features. Customers may integrate with these features using the reserved MQTT topics that AWS IoT features publish and subscribe to.

Finally, customers often ask when to select the Device SDKs, FreeRTOS, or AWS IoT Greengrass. While this article does not aim to provide a comprehensive overview of AWS IoT Greengrass or FreeRTOS, an simple way to classify these options is as follows: FreeRTOS for microcontrollers with a need for a real-time operating system, Greengrass is an open-source edge runtime that runs on a Linux or Windows operating systems and is commonly used to build applications as an edge gateway, and the Device SDKs are commonly used with devices that connect directly to AWS IoT services.

For more information, please see the AWS Documentation on Building solutions with the AWS IoT Device SDKs:

This article was originally published on November 7, 2022. AWS Services and features change over time, and this article will be updated periodically to reflect those changes

profile pictureAWS
published 2 years ago1787 views
1 Comment

Can you give recommendation on which libraries to use when integrating browser based clients or mobile apps with AWS IoT Core?

replied 2 years ago