You are on page 1of 5

A Reliable Architecture Based on

Reactive Microservices for IoT applications


Cleber Santana Leandro Andrade Brenno Mello
Federal Institute of Bahia Federal University of Bahia Federal University of Bahia
Salvador, Bahia, Brazil Salvador, Bahia, Brazil Salvador, Bahia, Brazil
cleberlira@ifba.edu.br leandrojsa@ufba.br brenno.mello@ufba.br

Ernando Batista José Vitor Sampaio Cássio Prazeres


Federal Institute of Bahia Federal University of Bahia Federal University of Bahia
Salvador, Bahia, Brazil Salvador, Bahia, Brazil Salvador, Bahia, Brazil
ernando.passos@ifba.edu.br jose.sampaio@ufba.br prazeres@ufba.br

ABSTRACT construction of large-scale systems that are more robust, resilient,


Microservices has recently been employed in Cloud Computing to elastic and better adapted to meet current demands. Microservices
support the construction of large-scale systems that are resilient, aim to build, manage and design architectures of small autonomous
elastic and best suited to meet today’s demands. In Internet of units [14]. The applications based on the Microservices architecture
Things (IoT) a set of smart applications can be built in the most are polyglot, that is, they are constructed from the programming
different scenarios and that can impact the daily routine of people’s language of the choice of the developer and the deployments are
lives. The development of applications and services at IoT brings carried out continuously [16], a few dozen times a day [24] and
challenges such as deployment, elasticity and resilience. Microser- hundreds of times in some cases[3], making the use of applications
vices developed with the characteristics of resilience, elasticity and by the numerous users more dynamic.
addressed to messages are considered reactive Microservices. Thus, Microservices are Cloud-native architectures, and applications
this paper proposes an architectural model based on reactive Mi- based on this architectural style are designed to be resilient to
croservices to improve the reliability of IoT applications from the incidents and disruptions in the infrastructure, however, in some
perspective of availability. scenarios these applications may fail and be unavailable for hours
and, in some cases, days (see CircleCI [7]), which has a negative
CCS CONCEPTS impact on the productive chain of these organizations.
In IoT currently, the world has 8.3 billion IoT devices and it is
• Information systems → Computing platforms; • Computer
estimated that by 2025 this number will reach 21.5 billion. These
systems organization → Distributed architectures.
new devices will be able to interact by providing new services
in different domains and environments, generating added value
KEYWORDS
for the user. IoT devices along with their tasks constitute domain
Reactive Microservices, IoT applications, Reliability, Availability, specific applications (e.g. smart cities, smart houses, healthcare)
Internet of Things and horizontal markets (e.g. ubiquitous computing and analytical
ACM Reference Format: services), which constitute domain-independent services [21]. For
Cleber Santana, Leandro Andrade, Brenno Mello, Ernando Batista, José instance, in the Fish Farm scenario, the monitoring of variables (e.g
Vitor Sampaio, and Cássio Prazeres. 2019. A Reliable Architecture Based hydrological, hydraulic and quality) can improve the cultivation
on Reactive Microservices for IoT applications. In Brazilian Symposium on of the species. In this scenario, Microservices can be distributed at
Multimedia and the Web (WebMedia ’19), October 29-November 1, 2019, Rio the edge of the network allowing elasticity and resilience to the
de Janeiro , Brazil. ACM, New York, NY, USA, 5 pages. https://doi.org/10. system [10]. Resilience is the ability to resist external and internal
1145/3323503.3345027
failures; and elasticity refers the ability to system respond according
to the variation of demand [8]. The system must use asynchronous
1 INTRODUCTION messages in order to guarantee low coupling, isolation and location
Nowadays, a few applications are using the Microservices architec- transparency communication patterns to resilient [4]. Compliance
ture in domains such as IoT and Mobile [15], in order to support the with these properties transforms the Microservices into a Reactive
Microservices [10].
Permission to make digital or hard copies of all or part of this work for personal or Reactive Microservices can increases the dependability of the ap-
classroom use is granted without fee provided that copies are not made or distributed
for profit or commercial advantage and that copies bear this notice and the full citation plications. Reliability is a priority requirement for IoT applications
on the first page. Copyrights for components of this work owned by others than ACM that are concerned with quality of service (QoS) [25]. It refers to the
must be honored. Abstracting with credit is permitted. To copy otherwise, or republish,
to post on servers or to redistribute to lists, requires prior specific permission and/or a
ability of a system to perform functions under specified conditions
fee. Request permissions from permissions@acm.org. for a specified period of time [13]. In addition, reliability takes into
WebMedia ’19, October 29-November 1, 2019, Rio de Janeiro , Brazil consideration four sub-characteristics such as: maturity, which is
© 2019 Association for Computing Machinery. the ability of an application to meet reliability needs under normal
ACM ISBN 978-1-4503-6763-9/19/10. . . $15.00
https://doi.org/10.1145/3323503.3345027

15
WebMedia ’19, October 29-November 1, 2019, Rio de Janeiro , Brazil C. Santana et al.

operation; availability, the ability of an application to be opera-


tional and accessible when required for use; fault tolerance, the
ability of an application to operate as intended despite the presence
of hardware or software faults and recoverability, which refers to
the ability of an application to recover the data directly affected,
in the event of failure, and to re-establish the desired state of the
application.
From these considerations, we claim that a monolithic architec-
ture may not be designed to deal with these issues. Therefore, this
leads to the need to design these applications with new architectural
approaches. In recent studies, [15] and [9] stated Microservices was
applied in IoT Applications and they can be deployed in Containers.
Container management systems, like Docker, and orchestration
systems, like Kubernetes, control applications and dynamically
provision their resources, which cloud services can be extremely
scalable, reliable, and reactive. Finally, in this paper we will discuss
our approach to the development of reliable IoT applications.
Figure 1: Fog Computing and Internet of Things [6].

2 PROPOSAL
2.1 Internet of Things Infrastructure 2.2 Archicteture
In these visions that the literature presents on Internet of Things Firstly, the architecture defines that an IoT application consists of a
there are some technologies that give sustentation for its operation. set of reactive Microservices that can be distributed on devices and
Cloud Computing is one of the computational paradigms applied in servers in Edge computing, Fog computing or Cloud computing.
IoT. Cloud frees the end user and the companies of the specification Figure 2 illustrates the proposal overview. In this architecture, the
and details of the computational infrastructure necessary for the applications layer has two main parts: (i) Reactive Microservices
operation of the applications. However, despite this ease, for latency- [10], which guides the IoT applications development; (ii) Integration
sensitive applications that require neighboring nodes to work in Container and Containers (Figure 2) which is the infrastructure
accordance with delay requirements, the Cloud Computing solution needed to implement the IoT applications. The characteristics of
is not the right choice. The Internet applications of Things are each component are discussed below.
framed in this perspective of latency sensitivity. In addition, they Reactive Microservices provides a architecture for the develop-
require mobility support, geographic distribution, and location ment of applications capable of handling issues of failure and loss of
awareness [5]. performance without affecting the behavior of an entire application.
Given this scenario, a new platform called Fog Computing emerges We divided the logical layer of the architecture into two parts: Core
to meet the requirements imposed by the applications described and Utilities. In Core we have the following components:
above. The researchers [6] explain that Fog Computing is not a new • IoT Message Channel provides a means of communication
paradigm that excludes Cloud Computing. Fog Computing enables so that different Microservices can communicate in a weakly
the creation of a new generation of applications and services that coupled way.
interact with cloud computing for data management and analysis. • Service Discovery Infrastructure provides an infrastruc-
Fog Computing is a virtualized platform that provides computing, ture for publishing and discovering services.
storage, and network infrastructure services for communication • Reactive broker provides the point of communication with
between cloud computing end devices and data centers. sensors and actuators through publish/subscribe messages.
The architecture of a Fog Computing infrastructure to support • Circuit breaker provides a means of avoiding cascading
the Internet Applications of Things is presented in Figure 1. This failures.
architecture is divided into four levels. The first level, Embedded • Timeout and Bulkhead enable low coupling between ser-
Systems and Sensors, is related to the network of sensors with low vices.
computational power and bandwidth that are employed for specific • Health check Provides access to the Microservices status:
tasks in the environment. The second level, Multi-Service Edge, is UP or Down.
where the distribution of services occurs at the edge of the network.
Through this, there is the possibility of achieving intelligence in The Utilities part of the architecture is used in our proposal to
the Fog Computing environment. At the Core layer, long-range provide support for the case studies to be implemented. In Utilities
communication technologies are applied, security and QoS require- we have the following components:
ments are also implemented. Finally, at the Data Center and Cloud • Streamming Provides real-time data analysis.
level is where applications that need more computing resources • RESTful Provides access to IoT devices.
are deployed, for example, processing, analysis and storage of the • Security Provides a layer for authentication and authoriza-
large amount of historical data generated by IoT environments. tion to services.

16
A Reliable Architecture Based on
Reactive Microservices for IoT applications WebMedia ’19, October 29-November 1, 2019, Rio de Janeiro , Brazil

Figure 2: Overview of proposal architecture

Integration Container In addition to the software components vary. Also, due to financial or time constraints, it is not always
provided in our proposal, we have adopted the use of container possible to test new functionalities (technologies, algorithms or
technologies to facilitate the deployment of the applications in the even architectures) directly in IoT environments with real devices.
devices and also to contribute in the improvement of availability In this context, it becomes useful to develop / adopt environ-
of IoT applications. Figure 3 illustrates the infrastructure adopted ments that can represent such IoT domains, especially when it
in this paper to deploy IoT applications. This infrastructure can is possible to use the same technologies / codes implemented in
be adopted in Edge, Fog and Cloud computing. This infrastructure real environments. In addition, emulated / simulated environments
can be deployed to devices with lower computing power (usually facilitate the acquisition of important QoS evaluation metrics in
located in Edge computing) and devices with high computing power IoT, such as network traffic, delay, jitter and packet loss [12]. The
(usually located in Fog and Cloud computing). simulation environment described in this section was implemented
using the Mininet 1 emulation tool. For this, the components of the
Fog of Things paradigm (described in Section 2.2 and works [20])
are considered: Sensors (virtual sensors), IoT Gateways (and their
technologies) and IoT Servers. Mininet is a network emulator that
allows for the creation of virtual hosts, switches, and links. The
devices created on Mininet can run real code, including applications
and libraries made for Linux systems, as well as the kernel's stack
and network. So, the codes developed can be tested on Mininet
instances (hosts) and then transferred to real devices with minimal
changes. These characteristics, combined with the flexibility in net-
working, position Mininet as a facilitator in the development and
prototyping of new solutions in IoT environments.
For modeling and simulation of a virtual sensor, some basic as-
pects must be respected: (i) simulation of sample collection(pseudo
samples) or consume data from real datasets and data storage of
short period; (ii) implantation of the communication protocol re-
Figure 3: Infrastructure for IoT application. sponsible for control the information flow among devices (sensors,
IoT Gateways, IoT Servers and Applications). The behavior and
architecture of the IoT Gateway and IoT Server components is the
2.3 Internet of Things Simulation same as described in Section 2.2 and works [10] [20] [1]. In this
An IoT environment can be implemented in different domains such case, all frameworks and codes created and executed in real envi-
as health, transportation and logistics, agriculture, security and ronments are used in the simulation with minimal or no changes.
home automation [11]. Although such domains have some common As described, IoT Simulation makes it possible to create IoT
characteristics (e.g., dynamicity, scalability, heterogeneity) [6] [18], environments (including Reliable Microservices applications) in a
some aspects related to the configuration of the IoT environment
and obtaining metrics that represent Quality of Service (QoS) may 1 http://mininet.org/

17
WebMedia ’19, October 29-November 1, 2019, Rio de Janeiro , Brazil C. Santana et al.

simpler way, since it is possible to run multiple instances of IoT [7] CIRCLE CI. 2015. DB performance issue Incident Report for CircleCI. CIRCLE CI.
devices through a single machine. In addition, it facilitates the Retrieved July 2, 2018 from https://status.circleci.com/incidents/hr0mm9xmm3x6
[8] Rodrigo da Rosa Righi, Everton Correa, MÃąrcio Miguel Gomes, and Cristiano An-
testing, debugging and acquisition of evaluation metrics, such as, drÃľ da Costa. 2018. Enhancing performance of IoT applications with load pre-
load balancing solution in IoT scenarios [2] and analysis of network diction and cloud elasticity. Future Generation Computer Systems 1, 1 (2018), 1–13.
traffic according to the type of communication between FoT-Devices https://doi.org/10.1016/j.future.2018.06.026
[9] Cleber Jorge Lira de Santana, Brenno de Mello Alencar, and Cassio Vinicius Ser-
and FoT-Gateway (i.e. sensors and IoT Gateways) [1]. afim Prazeres. 2018. Microservices: A Mapping Study for Internet of Things
Solutions. In 2018 IEEE International Symposium on Network Computing and
Applications (NCA). IEEE, Cambridge, MA, USA, 1–4.
3 RELATED WORKS [10] Cleber Jorge Lira de Santana, Brenno de Mello Alencar, and Cássio V. Serafim
Power and Kotonya[19] presented a framework that provides sup- Prazeres. 2019. Reactive Microservices for the Internet of Things: A Case Study
in Fog Computing. In Proceedings of the 34th ACM/SIGAPP Symposium on Applied
port for fault tolerance. Taherizadeh, Stankovski and Grobelnik[22] Computing (SAC ’19). ACM, New York, NY, USA, 1243–1251. https://doi.org/10.
presented a computing architecture forborchestration of Microser- 1145/3297280.3297402
vices from Edge Devices to Fog and Cloud Providers. Martins[17] [11] Flavia C. Delicato, Paulo F. Pires, Thais Batista, Everton Cavalcante, Bruno Costa,
and Thomaz Barros. 2013. Towards an IoT Ecosystem. In Proceedings of the First
presented a proposal for reengineering, in which an IoT mid- dle- International Workshop on Software Engineering for Systems-of-Systems (SESoS
ware that was developed from a monolithic architecture was recon- ’13). ACM, New York, NY, USA, 25–28. https://doi.org/10.1145/2489850.2489855
[12] R. Duan, X. Chen, and T. Xing. 2011. A QoS Architecture for IOT. In 2011
structed from the adoption of Microservices, whose objective was International Conference on Internet of Things and 4th International Conference
to improve the reliability and availability in the use of the IoT mid- on Cyber, Physical and Social Computing. IEEE, Dalian, China, 717–720. https:
dleware. Nunez[23] states that most existing middlewares partially //doi.org/10.1109/iThings/CPSCom.2011.125
[13] International Organization for Standardization/International Electrotechni-
meet the requirements of the IoT environment. In this context, the cal Commission et al. 2011. ISO/IEC 25010-Systems and software en-
authors affirm that there is a need for more research on issues such gineeringâĂŤsystems and software Quality Requirements and Evaluation
as scalability, dynamic resource discovery, reliability, performance (SQuaRE)âĂŤsystem and software quality models. Authors, Switzerland 1, 15
(2011), 1–15.
and security. [14] Martin Fowler and James Lewis. 2014. Microservices, 2014. URL:
Although these studies take into account reliability improve- http://martinfowler. com/articles/microservices. html 1, 1 (2014), 1–1.
[15] P. D. Francesco, I. Malavolta, and P. Lago. 2017. Research on Architecting Mi-
ment of IoT applications, they differ from this doctoral proposal in croservices: Trends, Focus, and Potential for Industrial Adoption. In 2017 IEEE
different aspects. In the work of [23] and [17], the researchers acted International Conference on Software Architecture (ICSA). IEEE, Gothenburg, Swe-
directly on the IoT middleware layer while this paper proposal den, 21–30. https://doi.org/10.1109/ICSA.2017.24
[16] Jez Humble and David Farley. 2011. Continuous delivery: reliable software releases
focuses on the application layer of the IoT architecture. The work through build, test, and deployment automation. Addison-Wesley Boston, EUA.
of[22] is focused on the orchestration of Microservices contained [17] Lucas M. C. e Martins, Francisco L. de Caldas Filho, Rafael T. de Sousa Júnior,
in containers that can be performed from Egde to Fog and Cloud. William F. Giozza, and João Paulo C.L. da Costa. 2017. Increasing the De-
pendability of IoT Middleware with Cloud Computing and Microservices. In
The work of [19] is a research related to the IoT application layer, Companion Proceedings of the10th International Conference on Utility and Cloud
which investigates reliability improvement of IoT applications from Computing (UCC ’17 Companion). ACM, New York, NY, USA, 203–208. https:
//doi.org/10.1145/3147234.3148092
the perspective of fault tolerance. [18] H. B. Pandya and T. A. Champaneria. 2015. Internet of things: Survey and
case studies. In 2015 International Conference on Electrical, Electronics, Signals,
4 FINAL REMARKS Communication and Optimization (EESCO). Scimago Journal, United States, 1–6.
https://doi.org/10.1109/EESCO.2015.7253713
In this paper we present an architecture proposal for the develop- [19] A. Power and G. Kotonya. 2018. A Microservices Architecture for Reactive
ment of IoT applications. Its objective is to improve the reliability and Proactive Fault Tolerance in IoT Systems. In 2018 IEEE 19th International
Symposium on "A World of Wireless, Mobile and Multimedia Networks" (WoWMoM).
of these applications from the perspective of availability. IEEE, Chania, Greece, 588–599. https://doi.org/10.1109/WoWMoM.2018.8449789
[20] C. Prazeres and M. Serrano. 2016. SOFT-IoT: Self-Organizing FOG of Things.
In 2016 30th International Conference on Advanced Information Networking and
REFERENCES Applications Workshops. IEEE, Crans-Montana, Switzerland, 803–808. https:
[1] E. Batista, L. Andrade, R. Dias, A. Andrade, G. Figueiredo, and C. Prazeres. 2018. //doi.org/10.1109/WAINA.2016.153
Characterization and Modeling of IoT Data Traffic in the Fog of Things Paradigm. [21] N. Shahid and S. Aneja. 2017. Internet of Things: Vision, application areas
In 2018 IEEE 17th International Symposium on Network Computing and Applications and research challenges. In International Conference on I-SMAC (IoT in Social,
(NCA). IEEE, Cambridge, MA, USA, 1–8. https://doi.org/10.1109/NCA.2018. Mobile, Analytics and Cloud) (I-SMAC). IEEE, Palladam, India, 583–587. https:
8548340 //doi.org/10.1109/I-SMAC.2017.8058246
[2] E. Batista, G. Figueiredo, M. Peixoto, M. Serrano, and C. Prazeres. 2018. Load [22] Salman Taherizadeh, Vlado Stankovski, and Marko Grobelnik. 2018. A Capillary
Balancing in the Fog of Things Platforms Through Software-Defined Networking. Computing Architecture for Dynamic Internet of Things: Orchestration of Mi-
In 2018 IEEE International Conference on Internet of Things (iThings) and IEEE croservices from Edge Devices to Fog and Cloud Providers. Sensors 18, 9 (2018),
Green Computing and Communications (GreenCom) and IEEE Cyber, Physical and 13–22. https://doi.org/10.3390/s18092938
Social Computing (CPSCom) and IEEE Smart Data (SmartData). IEEE, Halifax, NS, [23] Pedro M. Taveras NÃžÃśez. 2017. A Reactive Microservice Architectural Model with
Canada, Canada, 1785–1791. https://doi.org/10.1109/Cybermatics_2018.2018. Asynchronous Programming and Observable Streams as an Approach to Developing
00297 IoT Middleware. Ph.D. Dissertation. PUCMM. https://search.proquest.com/
[3] ZACK BLOOM. 2013. How We Deploy 300 Times a Day. Hubspot. Retrieved April docview/2026176055?accountid=14536 Copyright - Database copyright ProQuest
21, 2018 from https://product.hubspot.com/blog/how-we-deploy-300-times-a- LLC; ProQuest does not claim copyright in the individual underlying works;
day ÃŽltima atualizaÃğÃčo em - 2018-05-09.
[4] Jonas Bonér. 2017. Reactive Microsystems The Evolution of Microservices at Scale. [24] Mateusz Trojak. 2018. CI/CD at Scale. Brainly. Retrieved July 2, 2018 from
O’Reilly Media, Gravenstein Highway North, Sebastopol. https://medium.com/engineering-brainly/ci-cd-at-scale-fdfb0f49e031
[5] Flavio Bonomi, Rodolfo Milito, Preethi Natarajan, and Jiang Zhu. 2014. Fog [25] Gary White, Vivek Nallur, and SiobhÃąn Clarke. 2017. Quality of service ap-
computing: A platform for internet of things and analytics. In Big Data and proaches in IoT: A systematic mapping. Journal of Systems and Software 132
Internet of Things: A Roadmap for Smart Environments. Springer, Gewerbestrasse (2017), 186 – 203. https://doi.org/10.1016/j.jss.2017.05.125
11, 6330 Cham, Switzerland, 169–186.
[6] Flavio Bonomi, Rodolfo Milito, Jiang Zhu, and Sateesh Addepalli. 2012. Fog
computing and its role in the internet of things. In Proceedings of the first edition
of the MCC workshop on Mobile cloud computing. ACM, ACM, New York, NY,
USA, 13–16.

18
A Reliable Architecture Based on
Reactive Microservices for IoT applications WebMedia ’19, October 29-November 1, 2019, Rio de Janeiro , Brazil

5 BIO José Victor de Almeida Sampaio is a


DSc. Cassio Prazeres has been an assistant pro- graduation student at Federal University of
fessor at Federal University of Bahia (UFBA) Bahia (UFBA) and scientific initiation scholar of
since 2010, where he leads research activities FAPESB since 2018. Currently, Sampaio is partici-
and projects in the Web/Internet area, teaches pant in the Web, Internet and Intelligent Systems
under-graduate and post-graduate courses, and Research Group (WISER) where he develops works about Microser-
is advisor for Ph.D, M.Sc. and B.Sc. students. Also vices for the Internet of Things architecture and his research inter-
at UFBA, Prazeres is a co-founder and leader of Web, Internet and ests are in Internet of Things and Microservices.
Intelligent Systems Research Group (WISER). He received a Ph.D MSc. Ernando Batista received M.S. (2017)
(2009) in Computer Science from University of Sao Paulo (USP). in Computer Science at Federal University of
He has several publications in international conferences and jour- Bahia (UFBA) and Degree in Computer Engineer-
nals. Prazeres is member of: Brazilian Computer Society (SBC); ing at Federal University of Recôncavo da Bahia.
IEEE Communications Society; IEEE Computer Society Technical Batista is a researcher of the Web, Internet and
Committee on Services Computing; IEEE Smart Cities Technical Intelligent Systems Research Group (WISER) and
Community; IEEE Internet of Things Technical Community; ACM professor of the Federal Institute of Bahia (IFBA).
SIGWEB; W3C Web of Things Community Group. Recently, Dr.
Prazeres had a sabbatical year as a Post Doctoral Researcher at
Insight Centre for Data Analytics at the National University of
Ireland, Galway (NUIG).
Msc. Cleber Santana is a Ph.D. candidate at
Federal University of Bahia (UFBA) and received
M.S. (2015) in Computer Systems at UNIFACS. He
is a researcher of the Web, Internet and Intelligent
Systems Research Group (WISER) and Nucleus
of Mathematics in Computational Environment
(NUMAC), where he works in projects related to Microservices,
Internet of Things, Semantic Web Services and Education. Santana
is a member of IEEE Communications Society and he has publica-
tions in international and national conference. Since 2013, he has
been a professor of the Federal Institute of Bahia (IFBA) and his re-
search interests are Web Semantic, Microservices, Reactive Systems,
Containers, Internet of Things, Fog Computing, and Education.
Msc. Leandro Andrade is a Ph.D. candidate
at Federal University of Bahia (UFBA) and re-
ceived M.S. (2014) and B.S. (2012) in Computer
Science at UFBA. He is researcher of the Web,
Internet and Intelligent Systems Research Group
(WISER) where he works in projects related to
Internet of Things, Fog Computing and Big Data. In 2017, Andrade
has done a Ph.D. internship at Insight Centre for Data Analytics at
the National University of Ireland, Galway. Leandro is a member of
the Brazilian Computer Society (SBC) and IEEE Communications
Society.His research interests are Web Semantic, Web Services, In-
ternet of Things, Machine Learning, Education and Free Software.
Brenno de Mello is a MSc. candidate at Fed-
eral University of Bahia (UFBA) and received a
degree in Systems Analysis and Development
(2016) from the Federal Institute of Bahia (IFBA).
He has experience in the area of Computer Sci-
ence, with emphasis on Information Systems and
Software Engineer. Currently, Mello is participant in the Web, In-
ternet and Intelligent Systems Research Group (WISER) and his
research interests are in Internet of Things, Data Stream Mining,
Fog Computing and Smart Water.

19

You might also like