摘要
单体架构下的分布式事务是一个服务内访问多个数据源的分布式事务,可以采用传统分布式事务处理模型——DTP(Distributed Transaction Processing)模型来解决。在微服务的架构下,可能会出现跨服务、跨资源的分布式事务。在解决这类分布式事务时,微服务追求系统的可用性和最终一致性而非数据的强一致性。针对不同的微服务分布式事务场景,介绍不同的分布式事务处理模型,包括可靠消息模型、业务补偿模型和TCC(TryConfirm/Cancel)模型,并总结每种模型的处理流程和优缺点。对TCC模型在性能上和可移植性上提出优化方案。
The distributed transaction under the monolithic architecture can access multiple data resources within a service.It can be solved by using the traditional distributed transaction processing(DTP)model.Cross-service and cross-resource distributed transactions may occur under the microservice architecture.When solving such distributed transactions,microservices pursue system availability and eventual consistency rather than strong consistency of data.For different microservices distributed transaction scenarios,different distributed transaction processing models were introduced,including reliable message model,business compensation model and Try-Confirm/Cancel(TCC)model.And the process flow and advantages and disadvantages of each model were summarized.We proposed optimization scheme for TCC model in terms of performance and portability.
作者
方意
朱永强
宫学庆
Fang Yi;Zhu Yongqiang;Gong Xueqing(School of Computer Science and Software Engineering,East China Normal University,Shanghai 200062,China)
出处
《计算机应用与软件》
北大核心
2019年第1期152-158,共7页
Computer Applications and Software
关键词
微服务
分布式事务
DTP
可靠消息
业务补偿
TCC
Microservice
Distributed transaction
DTP
Reliable message
Business compensation
TCC