计算机科学 ›› 2021, Vol. 48 ›› Issue (12): 17-23.doi: 10.11896/jsjkx.210500078

• 计算机体系结构* 上一篇    下一篇

一种基于微服务架构的服务划分方法

江郑, 王俊丽, 曹芮浩, 闫春钢   

  1. 嵌入式系统与服务计算教育部重点实验室(同济大学) 上海201804
  • 收稿日期:2021-05-11 修回日期:2021-08-09 出版日期:2021-12-15 发布日期:2021-11-26
  • 通讯作者: 闫春钢(cgyan2@163.com)
  • 作者简介:zhengjiang@tongji.edu.cn
  • 基金资助:
    国家重点研发计划(2018YFC0831403)

Method of Service Decomposition Based on Microservice Architecture

JIANG Zheng, WANG Jun-li, CAO Rui-hao, YAN Chun-gang   

  1. Key Laboratory of Embedded System and Service Computing of Ministry of Education(Tongji University),Shanghai 201804,China
  • Received:2021-05-11 Revised:2021-08-09 Online:2021-12-15 Published:2021-11-26
  • About author:JIANG Zheng,born in 1996,postgra-duate.His main research interests include service computing,service decomposition and microservice.
    YAN Chun-gang,born in 1963,Ph.D,professor,Ph.D supervisor.Her main research interests include computer collaboration and service computing,trusted computing and Petri net modeling and analysis.
  • Supported by:
    National Key Research and Development Program of China(2018YFC0831403).

摘要: 对单体系统进行微服务划分能有效缓解单体架构中系统冗余、难以维护等问题,但是现有的微服务划分方法未能充分利用微服务架构的属性信息,导致服务划分结果的合理性不高。文中给出了一种基于微服务架构的服务划分方法。该方法通过系统服务与属性的关联信息来构建实体-属性关系图,然后结合微服务架构的特征信息与目标系统的需求信息制定服务划分规则,量化两类顶点之间的关联信息,生成实体-属性加权图,最后应用加权的GN算法自动地实现系统的微服务划分。实验结果表明,该方法在服务划分的时效性上有较大提升,并且生成的微服务划分方案在评估指标上的表现更好。

关键词: GN算法, 服务划分, 划分规则, 微服务架构, 问题建模

Abstract: The microservice decomposition of the monolithic system can effectively alleviate the problems of system redundancy and difficulty in maintenance of the monolithic architecture.However,the existing microservice decomposition methods fail to make full use of the attribute information of the microservice architecture,which leads to the low rationality of service decomposition results.This paper proposes a service decomposition method based on microservice architecture.The method constructs an entity-attribute relationship graph through the association information of system services and attributes.Then the service decomposition rules are formulated by combining the feature information of the microservice architecture with the demand information of the target system,the association information between the two types of vertices is quantified,and a weighted entity-attribute graph is generated.Finally,the weighted GN algorithm is applied to realize the microservice decomposition of the system automatically.The experimental results show that the method greatly improves the timeliness of service decomposition,and the gene-rated microservice decomposition scheme performs better in terms of various evaluation metrics.

Key words: Decomposition rules, GN algorithm, Microservice architecture, Problem modeling, Service decomposition

中图分类号: 

  • TP311
[1]RICHARDSON C.Monolithic Architecture[EB/OL].[2021-04-02].https://microservices.io/patterns/monolithic.html.
[2]LU Y F,CAO R H,WANG J L,et al.Method of Encapsulating Procuratorate Affair Services Based on Microservices[J].Computer Science,2021,48(2):33-40.
[3]WU W J,YU X,PU Y J,et al.Development of Complex Service Software in Microservice Era[J].Computer Science,2020,47(12):11-17.
[4]MAZLAMI G,CITO J,LEITNER P.Extraction of microser- vices from monolithic software architectures[C]//2017 IEEE International Conference on Web Services (ICWS).IEEE,2017:524-531.
[5]LEVCOVITZ A,TERRA R,VALENTE M T.Towards a technique for extracting microservices from monolithic enterprise systems[J].arXiv:1605.03175,2016.
[6]WU H Y,DENG W J.Research Progress on the Development of Microservices[J].Journal of Computer Research and Development,2020,57(3):525-541.
[7]AL-DEBAGY O,MARTINEK P.A Microservice Decomposition Method Through Using Distributed Representation of Source Code[J].Scalable Computing:Practice and Experience,2021,22(1):39-52.
[8]REN Z,WANG W,WU G,et al.Migrating web applications from monolithic structure to microservices architecture[C]//Proceedings of the Tenth Asia-Pacific Symposium on Internetware.2018:1-10.
[9]GYSEL M,KÖLBENER L,GIERSCHE W,et al.Service cut- ter:A systematic approach to service decomposition[C]//European Conference on Service-Oriented and Cloud Computing.Cham:Springer,2016:185-200.
[10]GYSEL M,KÖLBENER L.Service Cutter-A Structured Way to Service Decomposition[D].Rapperswil-Jona:HSR Hochschule für Technik Rapperswil,2015.
[11]DING D,PENG X,GUO X F,et al.Scenario-Driven and Bottom-Up Microservice Decomposition for Monolithic Systems[J].Journal of Software,2020,31(11):3461-3480.
[12]NEWMAN S.Building microservices:designing fine-grained systems[M].O'Reilly Media,2015:1-47.
[13]AHMADVAND M,IBRAHIM A.Requirements reconciliation for scalable and secure microservice (de) composition[C]//2016 IEEE 24th International Requirements Engineering Conference Workshops (REW).IEEE,2016:68-73.
[14]RICHARDSON C.Pattern:Microservice architecture[EB/OL].[2021-04-02].http://microservices.io/patterns/microservices.html.
[15]BARESI L,GARRIGA M,DE RENZIS A.Microservices identification through interface analysis[C]//European Conference on Service-oriented and Cloud Computing.Cham:Springer,2017:19-33.
[16]ABDULLAH M,IQBAL W,ERRADI A.Unsupervised learning approach for web application auto-decomposition into microservices[J].Journal of Systems and Software,2019,151:243-257.
[17]VON LUXBURG U.A tutorial on spectral clustering[J].Statistics and Computing,2007,17(4):395-416.
[18]PONS P,LATAPY M.Computing communities in large net- works using random walks[C]//International Symposium on Computer and Information Sciences.Berlin:Springer,2005:284-293.
[19]TRAAG V A.Faster unfolding of communities:Speeding up the Louvain algorithm[J].Physical Review E,2015,92(3):032801.
[20]GIRVAN M,NEWMAN M E J.Community structure in social and biological networks[J].Proceedings of the National Academy of Sciences,2002,99(12):7821-7826.
[21]NEWMAN M E J.Fast algorithm for detecting community structure in networks[J].Physical review E,2004,69(6):066133.
[22]YANG N.Research and application on service partition and selection strategy in microservice platform [D].Beijing:Beijing University of Posts and Telecommunications,2019.
[23]NEWMAN M E J,GIRVAN M.Finding and evaluating community structure in networks[J].Physical review E,2004,69(2):026113.
[24]EVANS E J,EVANS E.Domain-driven design:tackling complexity in the heart of software[M].Addison-Wesley Professional,2004:15-31.
[25]FRITZSCH J.From Monolithic Applications to Microservices:Guidance on Refactoring Techniques and Result Evaluation[D].Reutlingen:Reutlingen University,2018.
[26]LI S,ZHANG H,JIA Z,et al.A dataflow-driven approach to identifying microservices from monolithic applications[J].Journal of Systems and Software,2019,157:110380.
[1] 吴文峻, 于鑫, 蒲彦均, 汪群博, 于笑明.
微服务时代的复杂服务软件开发
Development of Complex Service Software in Microservice Era
计算机科学, 2020, 47(12): 11-17. https://doi.org/10.11896/jsjkx.200700181
Viewed
Full text


Abstract

Cited

  Shared   
  Discussed   
No Suggested Reading articles found!