| <?xml version="1.0" encoding="utf-8" standalone="yes"?> |
| <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> |
| <channel> |
| <title>核心概念 on ShardingSphere</title> |
| <link>https://shardingsphere.apache.org/document/current/cn/features/transaction/concept/</link> |
| <description>Recent content in 核心概念 on ShardingSphere</description> |
| <generator>Hugo -- gohugo.io</generator> |
| <language>en-us</language> |
| |
| <atom:link href="https://shardingsphere.apache.org/document/current/cn/features/transaction/concept/index.xml" rel="self" type="application/rss+xml" /> |
| |
| |
| <item> |
| <title>XA两阶段事务</title> |
| <link>https://shardingsphere.apache.org/document/current/cn/features/transaction/concept/2pc-xa-transaction/</link> |
| <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate> |
| |
| <guid>https://shardingsphere.apache.org/document/current/cn/features/transaction/concept/2pc-xa-transaction/</guid> |
| <description>两阶段事务提交采用的是 X/OPEN 组织所定义的DTP模型所抽象的 AP(应用程序), TM(事务管理器)和 RM(资源管理器) 概念来保证分布式事务的强一致性。 其中 TM 与 RM 间采用 XA 的协议进行双向通信。 与传统的本地事务相比,XA 事务增加了准备阶段,数据库除了被动接受提交指令外,还可以反向通知调用方事务是否可以被提交。 TM 可以收集所有分支事务的准备结果,并于最后进行原子提交,以保证事务的强一致性。 |
| Java 通过定义 JTA 接口实现了 XA 模型,JTA 接口中的 ResourceManager 需要数据库厂商提供 XA 驱动实现, TransactionManager 则需要事务管理器的厂商实现,传统的事务管理器需要同应用服务器绑定,因此使用的成本很高。 而嵌入式的事务管器可以以 jar 包的形式提供服务,同 Apache ShardingSphere 集成后,可保证分片后跨库事务强一致性。 |
| 通常,只有使用了事务管理器厂商所提供的 XA 事务连接池,才能支持 XA 的事务。Apache ShardingSphere 在整合 XA 事务时,采用分离 XA 事务管理和连接池管理的方式,做到对应用程序的零侵入。</description> |
| </item> |
| |
| <item> |
| <title>Seata 柔性事务</title> |
| <link>https://shardingsphere.apache.org/document/current/cn/features/transaction/concept/base-transaction-seata/</link> |
| <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate> |
| |
| <guid>https://shardingsphere.apache.org/document/current/cn/features/transaction/concept/base-transaction-seata/</guid> |
| <description>Seata是阿里集团和蚂蚁金服联合打造的分布式事务框架。 其 AT 事务的目标是在微服务架构下,提供增量的事务 ACID 语意,让开发者像使用本地事务一样,使用分布式事务,核心理念同 Apache ShardingSphere 一脉相承。 |
| Seata AT 事务模型包含TM (事务管理器),RM (资源管理器) 和 TC (事务协调器)。 TC 是一个独立部署的服务,TM 和 RM 以 jar 包的方式同业务应用一同部署,它们同 TC 建立长连接,在整个事务生命周期内,保持远程通信。 TM 是全局事务的发起方,负责全局事务的开启,提交和回滚。 RM 是全局事务的参与者,负责分支事务的执行结果上报,并且通过 TC 的协调进行分支事务的提交和回滚。 |
| Seata 管理的分布式事务的典型生命周期: |
| TM 要求 TC 开始一个全新的全局事务。TC 生成一个代表该全局事务的 XID。 XID 贯穿于微服务的整个调用链。 作为该 XID 对应到的 TC 下的全局事务的一部分,RM 注册本地事务。 TM 要求 TC 提交或回滚 XID 对应的全局事务。 TC 驱动 XID 对应的全局事务下的所有分支事务完成提交或回滚。 </description> |
| </item> |
| |
| </channel> |
| </rss> |