摘要
微服务架构和云平台容器化部署是当前软件工程实践中一个比较热门的话题,很多研究报告表明越来越多的软件开发者正在将单体架构向微服务架构转型。在将单体架构应用拆分成微服务架构应用的过程中,实施者面临着一个重要的挑战,即缺乏一个明确的方法将单体应用高效准确的进行拆分。针对这个问题,提出了一种基于数据库表的微服务拆分方法并实现了一个拆分工具。该方法通过收集项目中的所有SQL语句,并结合数据库表之间的主外键关系,生成表关联矩阵,根据这个表关联矩阵初步划分出一部分微服务。然后根据测试案例收集所有的交易链路,再结合交易链路分析表和微服务之间的关系,计算出独立的表和微服务的关联度矩阵,根据这个独立的表和微服务的关联度矩阵来完成最终的微服务数据库表的划分,最后按照提出的规则进行微服务代码的拆分。实验结果表明,所提方法可以帮助软件开发者高效准确地进行微服务拆分。
Microservice architecture and cloud platform container deployment are a hot topic in current software engineering practice.Many research reports show that more and more software developers are transforming single architecture to microservice architecture.In the process of splitting a single architecture application into a microservice architecture application,the implementer faces an important challenge,that is,the lack of a clear method to effectively and accurately split the single application.To solve this problem,a micro-service splitting method based on database tables is proposed and a splitting tool is implemented.This method generates a table association matrix by collecting all the SQL statements in the project and combining the primary and foreign key relationships between the database tables.According to this table association matrix,a part of microservices is initially divided.Then collect all the transaction links according to the test cases,and combine the relationship between the transaction link analysis table and the micro-service to calculate the association matrix of the independent table and the micro-service.According to the association matrix of the independent table and the micro-service,complete the division of the final micro-service database table,and finally split the micro-service code according to the proposed rules.The experiment shows that this method can help software developers effectively and accurately split microservices.
作者
黄志成
柳先辉
HUANG Zhicheng;LIU Xianhui(School of Electronics and Information Engineering,Tongji University,Shanghai 201800,China)
出处
《计算机科学》
CSCD
北大核心
2023年第S02期424-430,共7页
Computer Science
基金
国家重点研发计划项目(2022YFB330570)
上海市科技创新行动计划项目(21511104302)。
关键词
微服务
拆分
数据库表
Microservices
Splitting
Database table