Microservices as a Solution for IoT Architecture Challenges
Since the advent of Internet of Things (IoT) a decade ago, the number of connected devices has increased exponentially. It is expected that there will be more than 64B IoT devices worldwide by 2025 and that IoT has the potential to generate $4T to $11T in economic value by 2025 [4].
But what is IoT? IoT is described as a vast network of interconnected devices with embedded sensors that can collect data, and, in some cases, be controlled via the Internet [3]. IoT may be used in different industries, from devices for home automation, such as smart thermostats and remotely controllable lighting fixtures, to city planning, transportation, health, and agriculture. Because of that, IoT has become an operational necessity for many businesses, not merely a technology goal. The rapid growth of the IoT market has spawned a wide range of competing standards, tools, projects, policies, frameworks, and organizations seeking to define the ways in which connected devices communicate [3].
Due to the scale and complexity of the connected systems, IoT applications can be very difficult to develop, integrate, and scale in a way that is manageable or secure. One solution to mitigate these challenges is microservices, which are an architectural approach to software development where the software is composed of many small interconnected and independent services. These services are owned by small and self-contained teams. In this article, we will discuss how microservices can be combined with IoT, the components of microservices-based IoT, and examples of open source IoT and microservices projects.
How can microservices be combined with IoT?
Organizations can certainly benefit from the advantages of microservices when implementing IoT initiatives. That is, by leveraging technologies like containerization, modularity, independent deployment, and loose coupling, software teams can develop IoT apps more quickly and safer. We present below how microservices can be combined with IoT [1].
The components of microservices-based IoT
Now that you know how microservices can be combined with IoT applications, let’s take a look at the basic components of a microservices-based IoT. Basically, a microservices IoT application will connect to multiple edge locations such as home computers, GPS devices, or manufacturing lines. Hence, first, you will need the physical endpoints that will need to connect to software systems (such as sensors and mobile devices). Second, you will need an API gateway that acts as a single entry point for all external client/server requests, service messages, and API calls. Third, you will need a cloud-based infrastructure for computing, storing, and analyzing data in the cloud — here microservices can help to scale up or down your resources as needed. Fourth, it is necessary to use various messaging protocols to help with the communication and data exchanges between different software systems (e.g. JSON, XML, etc) — make sure your microservices framework can work with different protocols. Finally, it is necessary to have robust application monitoring tools responsible for identifying failures.
Open source tools to implement your microservices-based IoT
To start, you need a microservices framework. The TARS framework is ideal for building your IoT applications because it accepts different protocols and programming languages, and it can help you to scale up or down cloud resources as needed. Concerning IoT open source projects, there are a variety of tools available as shown in the image below. To learn more about such tools, check out this blog post.
Figure 1: Open source tools for IoT. Image extracted from [5] and adapted.
Connected Vehicles: A Microservices-based IoT use case in practice
A connected vehicle is capable of connecting wireless networks to nearby devices. Connected vehicles are an important factor in the advance of IoT since their use cases range from connected entertainment systems that connect with the driver’s mobile phone to Internet-connected vehicles that have bi-directional communication with other vehicles, mobile devices, and city intersections [6].
One way to implement a connected vehicles IoT infrastructure is by using Akraino. Akraino is a collection of open infrastructures and application blueprints for the Edge, having IoT as one of its use cases. One of their blueprints is The Connected Vehicle Blueprint (CVB) which focuses on establishing an open source multi-access edge computing (MEC) platform, which is the backbone for a Vehicle to Everything (V2X) application.
For example, let’s consider an application that is able to monitor the traffic situation, assess the driving risk, and notice an unexpected road event. To build this application, the architecture of the CVB could be composed of an ARM/X86 physical server, a virtualization layer, the TARS microservices platform layer, and the connected vehicle applications layer, as shown in Figure 2.
Figure 2: Example of an IoT architecture for connected vehicles
About the author:
Isabella Ferreira is an Ambassador at TARS Foundation, a cloud-native open-source microservice foundation under the Linux Foundation.
References:
[2] https://behrtech.com/blog/iot-architecture-3-reasons-why-microservices-matter/
[3] https://opensource.com/resources/internet-of-things
[4] https://techjury.net/blog/internet-of-things-statistics/#gref
[5] https://www.opensourceforu.com/2020/02/leveraging-open-source-tools-for-iot/
[6] https://www.digi.com/blog/post/what-is-connected-vehicle-technology-and-use-cases