错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

A Quantitative Assessment Method for Microservices Granularity to Improve Maintainability

  • Famke Driessen,
  • Luís Ferreira Pires,
  • João Luiz Rebelo Moreira,
  • Paul Verhoeven,
  • Sander van den Bosch

摘要

The popularity of microservices has increased over the past decade due to their potential benefits for distributed enterprise applications. Developing and maintaining a microservices architecture (MSA) is challenging, amongst others because the size (granularity) of the microservices has an impact on most system properties, such as, e.g., maintainability, performance, and scalability. Currently, architects determine the granularity of the microservices by identifying bounded contexts or business capabilities, which is mainly based on their experience. This paper presents a quantitative assessment method to evaluate the granularity of the microservices for improved system maintainability. The method is based on a set of metrics that are relevant for maintainability, namely change coupling, structural coupling, weighted service interface count, lines of code, service interface data cohesion, and change frequency. By evaluating these metrics, focusing on coupling, cohesion, and size, the method can assess refactors of an architecture in which microservices are merged or decomposed. We validated our method with three open source microservice-based projects with different sizes and structures. Our method can substantiate the design decisions concerning the granularity of microservices, identifying services that are candidates for merging and decomposition towards maintainability evolution, with clear benefits particularly for enterprise applications.