Font Size: a A A

A Model-Driven Design Method For Refactoring Legacy Monolith Into Microservices

Posted on:2024-05-29Degree:MasterType:Thesis
Country:ChinaCandidate:J L XiongFull Text:PDF
GTID:2568307106499454Subject:Computer Science and Technology
Abstract/Summary:PDF Full Text Request
As the scale and complexity of software systems increase,the continuous development and operation of monolithic architecture become increasingly tricky.Furthermore,due to the deepening of single technology bindings,the maintainability and evolvability of the system also rapidly decline.Microservices architecture aims to divide large and complex systems into several independent service components that are of moderate size,functionally cohesive,and have clear boundaries.Business collaboration is achieved through lightweight message passing between service components,which brings agility,flexibility,technical freedom,ease of maintenance,and ease of evolution to the system.Therefore,microservices architecture has become the software architecture standard in the industry.Migrating and refactoring from legacy monolithic systems to microservices architecture systems has become an essential option for implementing system evolution strategies in the ICT industry,including well-known enterprises such as Netflix and Amazon.However,there are still the following issues in implementing this migration:(1)how to build and express the design model of the microservice architecture: current related research can only obtain a collection of microservices without static structure and behavioural specifications.There is a lack of modeling elements that can strictly express microservices’ structure and behavioural design models.No appropriate methods and tools can automatically or intelligently support the construction of the microservice architecture design model.(2)How to support interactive modeling and continuous improvement of the microservice architecture design model: Currently,the vast majority of research work cannot interactively modify the architectural of the microservice collection results from the monolithic system’s split,resulting in the need to re-execute the microservice refactoring framework for any design changes,which is difficult to support efficient and convenient continuous updates to the design model;(3)How to support code generation from legacy systems to microservice architecture systems: As the ultimate implementation process of the system engineering of monolithic legacy system refactoring to microservice,automatic code generation is the most critical link,but so far,no relevant work has been able to solve this issue.Given the aboved problems,this thesis proposes a model-driven design method for refactoring legacy monolith into microservice,and has implemented a corresponding prototype tool based on this method.The main summary of our work is as follows:(1)In response to the lack of modeling elements and methods for microservice structure and behaviour design models,based on the industrial standard Unified Modeling Language(UML),we define a microservice diagram that can describe the static structure of microservices and a microservice sequence diagram that can describe dynamic behaviour through the UML Profile mechanism.We propose a method for automatically generating microservice models and corresponding designs based on legacy system runtime logs and source code.We use static and dynamic analysis to establish automatic evaluation indicators to assess microservice designs quantitatively.Based on these work,we developed a web prototype tool called MSA-Generator,enabling system designers to obtain microservice design models and their quantitative evaluation results quickly.(2)In response to the current issue that microservice refactoring tools cannot support interactive modeling and updating of system architecture models,a microservice integration modeling tool,MSA-Modeller,has been developed to enhance modeling and design capabilities further.MSA-Modeller consists of two parts: MSA-Modeller frontend modeling tool,based on web front-end development,provides primary modeling functions of microservices,including visual design of microservices and interactive adjustment of classes in microservice;MSA-Modeller desktop-end modeling tool,developed based on Eclipse’s Papyrus plugin,provides a visual representation of microservices,interactive modeling,and model syntax constraint verification.MSAModeller can load microservice models automatically generated by MSA-Generator for further modeling and design.(3)In response to the issue that existing microservice code generation methods cannot effectively utilize legacy system artefacts,reuse existing code,and convert it into microservice code,a method based on a microservice model and template technology is proposed to generate microservice code.This method takes the microservice model generated as input,converts the information in the model into an middle layer data structure to decouple the model and the code,and then inputs the middle layer data structure into different templates to obtain microservice code for various technical frameworks(currently supporting the Java Spring Cloud Alibaba technology).The generated code includes business microservice code,infrastructure microservice code,and test code.Based on the above content,a prototype tool called MSA-Coder has been developed to improve the efficiency of code refactoring and ensure the proper development of the code.(4)To demonstrate the effectiveness,efficiency,robustness,and practicality of the method and supporting tools proposed in this thesis,we conducted comparative experiments on microservice identification,tool performance,log-based functional completeness,and case studies on code generation using four open-source systems.Specifically,(a)we compared our microservice identification method with five other methods to demonstrate its effectiveness;(b)we compared the performance of our tool with two similar tools and showed that our tool has a shorter running time,accelerates modeling speed,and provides more diverse microservice design references;(c)we used statistical methods to demonstrate that our method does not cause any functional loss in legacy systems during refactoring;(d)we illustrated the practicality of the microservice code generated by our method through case studies.
Keywords/Search Tags:Microservice Models and Modeling, Legacy Monolith Refactoring, Model-driven Development Method, Computer Aided Software Engineering, Intelligent Software Engineering
PDF Full Text Request
Related items