## 2 Background and Related Work
### Microservice Architecture (MSA)  
Currently, there is a growing interest in MSA in both the industrial and research sectors due to its various advantages, including flexibility, agility, infrastructure automation and loose coupling [49; 50; 51]. MSA is considered a more refined and simplified version of SOA [33; 52], since this architecture responds to the needs of scalability of applications by segmenting the logic of an organization into a series of separate services that are executed as independent processes; that is, it is not necessary to use the same languages, databases or development platforms [53; 21; 54]. In addition, MSA inherits from SOA the concept of interoperability through the implementation of lightweight mechanisms such as HTTP-based API and others [39; 50; 55]. Many organizations have recognized the benefits in the migration of their legacy software to microservices-based solutions to enable their applications to evolve, rather than acquiring new third-party software [52; 54]. However, performing this process (known as granularity) requires using a pathway or model that can successfully migrate the application; consequently, this factor depends on the use of design patterns (e.g., decompose by business, by verb or use case, by subdomain or by nouns or resources) and how the performance stability of the services is affected [50; 51; 53; 56]. A description of the most significant studies of the new MSA solutions within the eHealth domain is necessary. [PERSON] et al. [57] present two technological solutions based on MSA (i.e., cognitive training \"VIRTRAEL\" and frailty prevention \"PREFRA\"). These solutions aim to integrate the different age-related aspects from the cognitive, physical and social levels; therefore, when addressing these factors, more complete and reliable assessments of the elderly are obtained. However, to achieve this objective, the systems must have the four essential software attributes of reusability, extensibility, interoperability and composition, since these are required for the design, development and implementation of more complex functionalities that make use of different recent technologies (e.g., web or mobile). They have shown that the proposed technologies are a viable solution aimed at meeting the required quality attributes. [PERSON] et al. [58] develop an MSA-based system that collects sensory data of the elderly in their daily activities (e.g., toilet hygiene or functional mobility); these data include not only a physical dimension but also cognitive and social dimensions. This system is supported by using IoT (i.e., wearable devices), which are used by microservices focused on the collection, analysis and interpretation of data. In addition, this system is supported by several machine learning algorithms (e.g., kNN, RF or NB) to build more accurate models for detecting anomalies in people [59]. [PERSON] et al. [17] provide a model focused on semantic interoperable data-driven microservices. This model is responsible for capturing, representing and analyzing various types of data related to depressive disorders (DD). These data are vital to providing the model with a way to monitor the symptoms of DD through the use of indicators (e.g., user facial expressions, voice tone, user emotions from wearable sensors, social network services posts (SNS) and tweets). Generally, microservices do not make intelligent decisions based on data [60]; therefore, it is necessary to implement the following two dedicated servers in the model for this scenario: data mining/machine learning (extracts features and monitors the symptoms from the sensor data and SNS) and web of objects server (applies the semantic web technologies and inference of the user situation to provide the services to the users). [PERSON] et al. [30] propose a tool called Microservice4 EHR, which is based on the OpenEHR standard used for the computational representation of EHR (archetype) [61] and the conceptualization of a microservices-oriented software architecture.