The microservices architectural style is widely favored for its scalability, reusability, and easy maintainability, prompting increased adoption by developers. However, transitioning from a monolithic to a microservices-based architecture is intricate and costly. In response, we present a novel method utilizing clustering to identify potential microservices in a given monolithic application. Our approach employs a density-based clustering algorithm considering static analysis, structural, and semantic relationships between classes, ensuring a functionally and contextually coherent partitioning. To assess the reliability of our microservice suggestion approach, we conducted an in-depth analysis of hyperparameter sensitivity and compared it with two established clustering algorithms. A comprehensive comparative analysis involved seven applications, evaluating against six baselines, utilizing a dataset of four open-source Java projects. Metrics assessed the quality of generated microservices. Furthermore, we meticulously compared our suggested microservices with manually identified ones in three microservices-based applications. This comparison provided a nuanced understanding of our approach's efficacy and reliability. Our methodology demonstrated promising outcomes, showcasing remarkable effectiveness and commendable stability.
翻译:微服务架构风格因其可扩展性、可复用性和易维护性而广受青睐,促使开发者越来越多地采用该架构。然而,从单体架构向微服务架构的过渡复杂且成本高昂。为此,我们提出了一种利用聚类技术在给定单体应用中识别潜在微服务的新方法。该方法采用基于密度的聚类算法,综合考虑类之间的静态分析、结构及语义关系,确保功能与上下文的一致性划分。为评估微服务建议方法的可靠性,我们深入分析了超参数敏感性,并将其与两种成熟的聚类算法进行了对比。基于四个开源Java项目的数据集,我们针对七项应用展开了全面比较,评估了六种基线方法,并通过相关指标衡量所生成微服务的质量。此外,我们还将建议的微服务与三个微服务应用中手动识别的微服务进行了细致对比,从而深入理解所提方法的有效性与可靠性。实验结果表明,我们的方法展现出了显著的有效性和令人满意的稳定性。