计算机科学 ›› 2023, Vol. 50 ›› Issue (11A): 230200102-7.doi: 10.11896/jsjkx.230200102

• 大数据&数据科学 • 上一篇    下一篇

基于数据库表的微服务拆分方法

黄志成, 柳先辉   

  1. 同济大学电子与信息工程学院 上海 201800
  • 发布日期:2023-11-09
  • 通讯作者: 柳先辉(xianhui_l@163.com)
  • 作者简介:(540955198@qq.com)
  • 基金资助:
    国家重点研发计划项目(2022YFB330570);上海市科技创新行动计划项目(21511104302)

Microservice Splitting Approach Based on Database Table

HUANG Zhicheng, LIU Xianhui   

  1. School of Electronics and Information Engineering,Tongji University,Shanghai 201800,China
  • Published:2023-11-09
  • About author:HUANG Zhicheng,born in 1995,master candidate.His main research interests include micro service,cloud native.
    LIU Xianhui,born in 1979,Ph.D,associate researcher.His main research interests include machine learning,data mining andbig data,networked manufacturing.
  • Supported by:
    National Key Research and Development Program of China(2022YFB330570) and Science and Technology Innovation Action Plan Program of Shanghai(21511104302).

摘要: 微服务架构和云平台容器化部署是当前软件工程实践中一个比较热门的话题,很多研究报告表明越来越多的软件开发者正在将单体架构向微服务架构转型。在将单体架构应用拆分成微服务架构应用的过程中,实施者面临着一个重要的挑战,即缺乏一个明确的方法将单体应用高效准确的进行拆分。针对这个问题,提出了一种基于数据库表的微服务拆分方法并实现了一个拆分工具。该方法通过收集项目中的所有 SQL 语句,并结合数据库表之间的主外键关系,生成表关联矩阵,根据这个表关联矩阵初步划分出一部分微服务。然后根据测试案例收集所有的交易链路,再结合交易链路分析表和微服务之间的关系,计算出独立的表和微服务的关联度矩阵,根据这个独立的表和微服务的关联度矩阵来完成最终的微服务数据库表的划分,最后按照提出的规则进行微服务代码的拆分。实验结果表明,所提方法可以帮助软件开发者高效准确地进行微服务拆分。

关键词: 微服务, 拆分, 数据库表

Abstract: 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.

Key words: Microservices, Splitting, Database table

中图分类号: 

  • TP311
[1]AHMADVAND M,IBRAHIM A.Requirements reconciliationfor scalable and secure microservice (de) composition[C]//Proceedings of the 2016 IEEE 24th International Requirements Engineering Conference Workshops(REW).2016.
[2]GYSEL M,KÖLBENER L,GIERSCHE W,et al.Service cut-ter:A systematic approach to service decomposition[C]//Proceedings of the European Conference on Service-Oriented and Cloud Computing.2016.
[3]LEVCOVITZ A,TERRA R,VALENTE M T.Towards a technique for extracting microservices from monolithic enterprise systems [J].arXiv:160503175,2016.
[4]BARESI L,GARRIGA M,RENZIS A D.Microservices identification through interface analysis[C]//Proceedings of the European Conference on Service-Oriented and Cloud Computing.2017.
[5]CHEN R,LI S,LI Z.From monolith to microservices:A dataflow-driven approach[C]//Proceedings of the 2017 24th Asia-Pacific Software Engineering Conference (APSEC).2017.
[6]MAZLAMI G,CITO J,LEITNER P.Extraction of microser-vices from monolithic software architectures[C]//Proceedings of the 2017 IEEE International Conference on Web Services(ICWS).2017.
[7]ESKI S,BUZLUCA F.An automatic extraction approach:Transition to microservices architecture from monolithic application[C]//Proceedings of the Proceedings of the 19th International Conference on Agile Software Development:Companion.2018.
[8]KAMIMURA M,YANO K,HATANO T,et al.Extracting candidates of microservices from monolithic application code[C]//Proceedings of the 2018 25th Asia-Pacific Software Engineering Conference(APSEC).2018.
[9]RADEMACHER F,SORGALLA J,SACHWEH S.Challengesof domain-driven microservice design:A model-driven perspective [J].IEEE Software,2018,35(3):36-43.
[10]DING D,PENG X,GUO X F,et al.Scenario-Driven and Bottom-Up Microservice Decomposition for Monolithic Systems[J].Ruan Jian Xue Bao/Journal of Software,2020,31(11):3461-3480.
[11]LI S S,RONG G P,GAO Q Y,et al.Optimized dataflow-dri-ven approach for microservices-oriented decomposition[J].Ruan Jian Xue Bao/Journal of Software,2021,32(5):1284-1301.
[12]JIN W,LIU T,CAI Y,et al.Service Candidate Identification from Monolithic Systems based on Execution Traces [J].IEEE Transactions on Software Engineering,2019,47(5):987-1007.
[13]DESAI U,BANDYOPADHYAY S,TAMILSELVAM S.Graph Neural Network to Dilute Outliers for Refactoring Monolith Application[C]//Proceedings of the AAAI Conference on Artificial Intelligence.2021.
[14]MITCHELL B S,MANCORIDIS S.On the Automatic Modula-rization of Software Systems Using the Bunch Tool [J].IEEE Transaction on Software Engineering,2006,32(3):193-208.
[15]MAZLAMI G,CITO J,LEITNER P.Extraction of Microser-vices from Monolithic Software Architectures[C]//Proceedings of the IEEE International Conference on Web Services.2017.
[16]KALIA A K,JIN X,CHEN L,et al.Mono2Micro:an AI-based toolchain for evolving monolithic enterprise applications to a microservice architecture[C]//Proceedings of the Proceedings of the 28th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering.2020.
[17]SAEIDI A M,HAGE J,KHADKA R,et al.A search-based approach to multi-view clustering of software systems[C]//Proceedings of the 2015 IEEE 22nd International Conference on Software Analysis,Evolution,and Reengineering (SANER).2015.
[18]SCANNIELLO G,D′AMICO A,D′AMICO C,et al.An ap-proach for architectural layer recovery[C]//Proceedings of the Acm Symposium on Applied Computing.2010.
[19]WU J,HASSAN A E,HOLT R C.Comparison of clustering algorithms in the context of software evolution[C]//Proceedings of the IEEE International Conference on Software Maintenance.2005.
Viewed
Full text


Abstract

Cited

  Shared   
  Discussed   
No Suggested Reading articles found!