Runtime Adaptation of Microservices - SAMPAIO JUNIOR, Adalberto Ribeiro (2018)
The architectural style of Microservices is an approach that uses small pieces of software, each one with a single responsibility and well-defined boundaries, integrated with lightweight and general purpose communication protocols to build an application. The decoupling promoted by microservice usage makes continuous delivery cheaper and safer to be applied in comparison to other architectural styles thus allowing a microservice-based application (App) to be continuously updated and upgraded at runtime. For this reason, many companies have adopted microservices to facilitate the development and maintenance of their applications. However, high decoupling and a large number of microservices and technologies adopted, make it difficult to control a App. Despite the Microservice’s architectural style relying on tools to automatically manage the deployment and execution of Apps, these tools are not aware of the application’s behaviour. Therefore, most decisions are made manually by engineers, that analyze application logs, metrics, messages and take actions in response to triggers. This characteristic makes it difficult to make optimal decisions at runtime (i.e., optimizing the placement of microservices in the cluster). This thesis proposes an approach to bring autonomy to the microservice management tools by automatically evaluating the App’s behaviour, allowing alterations to be made with minimum intervention. To achieve that, we present REMaP, a MAPE-K based framework that inspects and adapts App in a cluster through a model at run-time. This model abstracts several technologies and semantics of Apps cohesively, allowing decisions to be computed without the supervision of engineers. To show the feasibility of this autonomic approach, we used REMaP to optimize the placement of microservices at runtime by autonomously monitoring the App’s behaviour, computing a (quasi-) optimal placement and re-configuring the App at runtime. Our approach allowed us to determine that it was possible to save up to 85% of servers used in the deployment of App by maintaining and, in some cases improving, its overall performance.