## 4 Model and Design of SPIDEP Platforms
### Variants of Software Architectures
#### 4.2.4. SPIDEP MSA Variant: Platform Design  
The second proposed platform (SPIDEP-MSA) is geared to the use of microservices in the expected medical scenarios of infectious diseases (like its other variant) [21; 22; 24], as shown in Figure 2.  
Both platforms aim to support the interpretation of changes in vital signs of elderly people living in residential facilities, thus alerting the medical team in advance of possible infections; however, the MSA variant has a recommender system to improve decision support in the prediagnosis of infectious diseases [25; 92]. Following, we will briefly explain the flow of the SPIDEP platform in relation to microservices [23]:  
* Edge architecture: Manages the collection, preprocessing and sending of data from the different biometric sensors (e.g., ECG, blood pressure, SPO2 or others), whose data are backed up locally. If necessary, temporary actions can be performed (e.g., delete, filter or update) before the data are sent to the Cloud architecture, which enables analysis with local data to streamline decision making in case of emergency [16; 93]. It should be noted that the connections with each APP are made asynchronously and independently for each stakeholder.
* User communication: Provides the necessary mechanisms for correct communication between the different layers and sublayers (e.g., data, validation of credentials or other). This communication is achieved through the representational state transfer (REST) protocol and its methods (i.e., GET, POST, PATCH and DELETE); however, this protocol requires the use of an API gateway. Therefore, taking advantage of some of the strengths of MSA (e.g., decoupling and isolation of microservices) [30], the  
Figure 2: General scheme of the services applied in the SPIDEP platform under the MSA variant (SPIDEP-MSA).  
Backends for Frontends design was implemented in the API gateway [56; 89]. Requests are handled by each stakeholder (i.e., desktop, mobile and third-party source) and not traditionally (i.e., single entry point); consequently, additional security mechanisms must be implemented for their validation [7; 94; 95].
* Cloud architecture: Provides services for end users (e.g., core or auxiliary microservices) according to their needs and the levels of user roles and permissions [21]. In addition, it manages the stored data of the different DBMS (database per service) [54; 96] to provide benefits to target users (e.g., patients, medical personnel or health authorities) [16]. Similarly, we must remember the strengths and weaknesses of MSA. The strengths of microservices are the following:
* Each microservice is encapsulated; therefore, it has more flexibility to use new frameworks, libraries, data sources and other resources [64].
* It allows horizontal scaling of the services instead of vertical scaling as in the case of a traditional or monolithic SOA, which facilitates the ability to use more computing resources (e.g., CPU, GPU and RAM) that will act as a single unit; however, it can be distributed through multiple virtual networks [50; 55].
* Each microservice is autonomous, has independence in the execution of its tasks, can be hosted in a specific server on the Internet, is available on the Internet (i.e., any software can interact with it) and does not share the same resources [30; 97; 98].
* The fault isolation can be obtained without interrupting the normal functioning of the whole system [16; 52].
* However, when applying MSA, the following weaknesses or difficulties must also be considered:
* MSA provides many different advantages, but it also increases a solution's complexity. To address increased complexity, an organization should prepare the specific infrastructure for microservices (i.e., obtain a clear picture of the data structure) [64; 99].
* If the level of granularity is determined before knowing the business process or the useful life of the platform, it can lead to problems in the reasoning about the services (e.g., if a microservice should be decomposed or merged with another) [33; 51].