Defining and measuring microservice granularity-a literature overview

PeerJ Comput Sci. 2021 Sep 8:7:e695. doi: 10.7717/peerj-cs.695. eCollection 2021.

Abstract

Background: Microservices are an architectural approach of growing use, and the optimal granularity of a microservice directly affects the application's quality attributes and usage of computational resources. Determining microservice granularity is an open research topic.

Methodology: We conducted a systematic literature review to analyze literature that addresses the definition of microservice granularity. We searched in IEEE Xplore, ACM Digital Library and Scopus. The research questions were: Which approaches have been proposed to define microservice granularity and determine the microservices' size? Which metrics are used to evaluate microservice granularity? Which quality attributes are addressed when researching microservice granularity?

Results: We found 326 papers and selected 29 after applying inclusion and exclusion criteria. The quality attributes most often addressed are runtime properties (e.g., scalability and performance), not development properties (e.g., maintainability). Most proposed metrics were about the product, both static (coupling, cohesion, complexity, source code) and runtime (performance, and usage of computational resources), and a few were about the development team and process. The most used techniques for defining microservices granularity were machine learning (clustering), semantic similarity, genetic programming, and domain engineering. Most papers were concerned with migration from monoliths to microservices; and a few addressed green-field development, but none address improvement of granularity in existing microservice-based systems.

Conclusions: Methodologically speaking, microservice granularity research is at a Wild West stage: no standard definition, no clear development-operation trade-offs, and scarce conceptual reuse (e.g., few methods seem applicable or replicable in projects other than their initial proposal). These gaps in granularity research offer clear options to investigate on continuous improvement of the development and operation of microservice-based systems.

Keywords: Metrics; Micro service architecture; Micro-service granularity; Microservices decomposition; Monolith to microservices; Quality attributtes; Service computing; Sistematic literature review.

Grants and funding

This work was supported by Colombia’s Ministry of Science and Technology (Minciencias-Colciencias) through doctoral scholarship “753-Formación de capital humano de alto nivel para el departamento Norte de Santander”; by the Francisco de Paula Santander University (Cúcuta, Colombia) through the doctoral studies commission number 14 of 2016; by the Universidad del Valle (Cali, Colombia); and by ANID (Chile) through PIA/APOYO AFB180002. There was no additional external funding received for this study. The funders had no role in study design, data collection and analysis, decision to publish, or preparation of the manuscript.