The essential building blocks of an IoT architecture
“Of all the technology trends that are taking place right now, perhaps the biggest one is the Internet of Things; it’s the one that’s going to give us the most disruption as well as the most opportunity over the next five years,” according to Wired. That might sound like hyperbole, but interconnecting the physical and digital worlds opens the door for a wide spectrum of fascinating applications. To succeed in this journey, it’s essential to come up with a well-defined IoT architecture when building an IoT solution.
The IoT is already boosting a significant amount of innovation across various industries by providing near real-time insight into rich and contextual environmental data across a wide range of complex scenarios, such as the industrial internet, smart homes and cities, energy management, agriculture, intelligent transport systems, connected health and smart retail.
To identify the essential building blocks of IoT architecture, it’s helpful to review the IoT reference architectures that have been created by several bodies and industry consortia, such as the following:
- The Industrial Internet Consortium has delivered the Industrial Internet Reference Architecture (IIRA), with a strong industry focus specifically on industrial IoT applications.
- The Internet of Things IoT-A EU initiative delivered a detailed architecture and model from the functional and information perspectives.
- The Reference Architecture Model Industrie 4.0 (RAMI 4.0) goes beyond IoT, adding manufacturing and logistics details. This is effectively a reference architecture for smart factories dedicated to IoT standards that started in Germany.
- The IEEE P2413 project formed a working group dedicated to the IoT’s architectural framework, highlighting protection, security, privacy and safety issues.
- Physical devices: The “things” in the IoT
- The gateway: An edge component to connect resource-constrained devices
- Integration: An enterprise service bus and message broker
- Applications: Data processing and analytics, for example
Physical sensors and actuators measure parameters and translate them into electrical signals. They’re connected to or integrated into devices, which in turn communicate in one of two ways:
- Directly, with the integration layer over IP protocols such as REST, Message Queue Telemetry Transport (MQTT), Extensible Messaging and Presence Protocol (XMPP) or Advanced Message Queuing Protocol (AMQP)
- Indirectly, over a gateway for devices with a small footprint (Constrained Application Protocols), short-range communication (such as Zigbee devices connected via a Zigbee gateway) or Bluetooth Low Energy devices connecting via a mobile phone
MQTT is a popular protocol due to its very small overhead (as little as 2 bytes per message) and design for intermittently connected networks. There’s even a variant for Zigbee-based wireless communication, dubbed MQTT For Sensor Networks (MQTT-SN).
This component provides the required technologies and functionalities to translate from various equipment protocols and forwards the data leverage in one of the IP transports mentioned above. On top of providing the transport, the gateway can also optionally provide functions such as data filtering, cleanup, aggregation and packet content inspection.
Managing the devices along the lifecycle includes onboarding, providing unique IDs, enrolling in identity and asset management systems and updating firmware. This is indicated in the control flow from the application tier all the way to the devices. Just as important as management is end-to-end security designed into all layers of an IoT solution. Learn more about IoT security.
Typically hosted in the cloud, this layer is responsible for receiving data from the connected devices and storing it either in-memory or in databases. Deeper analysis of the incoming data at higher levels is performed over the collected device data. The integration layer effectively translates the event-based stream into chunks of data that allow query-based processing in subsequent steps. A well-known open source implementation of this layer is Apache Kafka, a stream processing platform for building real-time data pipelines and streaming apps.
Storing the incredible amount of specialized IoT data sets (such as time series data) in the appropriate structure and format with maximum performance and availability is a significant challenge. Distributed NoSQL databases provide the read and write performance as well as the scalability and availability IoT applications require while running on cheap commodity hardware in the cloud. The distributed nature, masterless architecture and ability to replicate across data centers also allows the data to be kept close to the users and consumers.
In many scenarios, applications have to process the incoming data in near real-time to detect anomalies, filter events and enrich the data for machine learning and prediction. The Watson IoT platform provides a common, standard language devices can use to communicate with the platform over the internet. After the data is received, analytics can be applied and made available to applications that meet industry-specific needs.
Nathan Marz coined the term “lambda architecture” for a generic, scalable and fault-tolerant data processing architecture, with data, batch, serving and speed layers. It’s possible to build out such an advanced solution in Bluemix using frameworks such as Apache Kafka, Apache Cassandra and Apache Spark for downstream processing, which I’ll discuss in my next article.