| With the change in business scale and requirements,the problems of low development efficiency,high maintenance cost and weak expansion ability of traditional monolithic system architecture have become prominent.Microservice architecture has the characteristics of mixed development,flexible expansion and easy maintenance.Refactoring legacy systems into microservice architecture can improve the efficiency of software system development,operation and maintenance,and enhance system scalability.However,there are many challenges in the process of microservice refactoring,and database decomposition is the key problem to be solved.If the database is not decomposed or decomposed improperly,the performance and availability of the refactored system will be reduced.Aiming at the problem of database decomposition in the process of microservice refactoring,this thesis proposes a decomposition method of relational database oriented to microservice refactoring.The method combines static analysis and dynamic analysis to build the relational database inter table correlation matrix,and then the correlation matrix is clustered by spectral clustering algorithm to obtain the decomposed results of database,and the decomposed results are automatically matched with the microservices.Finally,according to the decomposed results of the relational database and microservice description,the monolithic system is refactored into microservice architecture,and a solution for data consistency problems is provided in the refactoring process.Based on the above relational database decomposition method,an automatic relational database decomposition tool is designed and implemented and verified by experiments.The tool implements the functions of inter table relationship analysis,database decomposition,and matching between the decomposed results and microservices.The microservice refactoring practice was carried out for the monolithic system JPet Store,and the tool provides effective support for database decomposition in the refactoring process.The practice results show that the method proposed in this thesis ensures the rationality of the decomposed results of the relational database,and the refactored system functions normally and the operation is stable. |