Fescar: Fast & Easy Commit And Rollback
Fescar is an easy-to-use, high-performance, java based, open source distributed transaction solution.
What is Fescar?
A distributed transaction solution with high performance and ease of use for microservices architecture.
Distributed Transaction Problem in Microservices
Let's imagine a traditional monolithic application. Its business is built up with 3 modules. They use a single local data source.
Naturally, data consistency will be guaranteed by the local transaction.
Things have changed in microservices architecture. The 3 modules mentioned above are designed to be 3 services on top of 3 different data sources (Pattern: Database per service). Data consistency within every single service is naturally guaranteed by the local transaction.
But how about the whole business logic scope?
How Fescar do?
Fescar is just a solution to the problem mentioned above.
Firstly, how to define a Distributed Transaction?
We say, a Distributed Transaction is a Global Transaction which is made up with a batch of Branch Transaction, and normally Branch Transaction is just Local Transaction.
There are 3 basic components in Fescar:
- Transaction Coordinator(TC): Maintain status of global and branch transactions, drive the global commit or rollback.
- Transaction Manager(TM): Define the scope of global transaction: begin a global transaction, commit or rollback a global transaction.
- Resource Manager(RM): Manage resources that branch transactions working on, talk to TC for registering branch transactions and reporting status of branch transactions, and drive the branch transaction commit or rollback.
A typical lifecycle of Fescar managed distributed transaction:
- TM asks TC to begin a new global transaction. TC generates an XID representing the global transaction.
- XID is propagated through microservices' invoke chain.
- RM register local transaction as a branch of the corresponding global transaction of XID to TC.
- TM asks TC for committing or rollbacking the corresponding global transaction of XID.
- TC drives all branch transactions under the corresponding global transaction of XID to finish branch committing or rollbacking.
For more details about principle and design, please go to Fescar wiki page.
History
- TXC: Taobao Transaction Constructor. Alibaba middleware team start this project since 2014 to meet distributed transaction problem caused by application architecture change from monolithic to microservices.
- GTS: Global Transaction Service. TXC as an Aliyun middleware product with new name GTS was published since 2016.
- Fescar: we start the open source project Fescar based on TXC/GTS since 2019 to work closely with the community in the future.
Maven dependency
<fescar.version>0.4.0</fescar.version> <dependency>
<groupId>com.alibaba.fescar</groupId>
<artifactId>fescar-all</artifactId>
<version>${fescar.version}</version>
</dependency>
Fescar: Fast & Easy Commit And Rollback的更多相关文章
- JDBC Tutorials: Commit or Rollback transaction in finally block
http://skeletoncoder.blogspot.com/2006/10/jdbc-tutorials-commit-or-rollback.html JDBC Tutorials: Com ...
- mysql事务,START TRANSACTION, COMMIT和ROLLBACK,SET AUTOCOMMIT语法
http://yulei568.blog.163.com/blog/static/135886720071012444422/ MyISAM不支持 START TRANSACTION | BEGIN ...
- 14.5.2.2 autocommit, Commit, and Rollback
14.5.2.2 autocommit, Commit, and Rollback 在InnoDB,所有的用户活动发生在一个事务里, 如果自动提交模式是启用的, 每个SQL语句形成一个单独的事务.默认 ...
- 14.3.2.2 autocommit, Commit, and Rollback 自动提交 提交和回滚
14.3.2.2 autocommit, Commit, and Rollback 自动提交 提交和回滚 如果自动提交模式被启用,在InnoDB里, 所有的用户活动发生在一个事务里, 每个SQL语句 ...
- flume-sink报错 java.lang.IllegalStateException: close() called when transaction is OPEN - you must either commit or rollback first
1. 确认代码无误(根据情况修改,表示若获得不了数据不会自动commit或者rollback): Event event = channel.take(); if (event == null) { ...
- 说commit,rollback
事务执行失败后,看做的是commit还是rollback:commit是把执行成功的部分提交了,rollback就是全回滚了.如果rollback失败了,此时不处理,等到客户端断开,MySQL内部默认 ...
- oracle 基础知识(五)--回滚(commit和rollback)
一,commit 01,commit干了啥 commit 就是提交的意思.也就是当你把99%的东西都做好了,然后你执行最后一步的操作...再commit前的话你可能啪啪啪啪啪,敲了几百条sql DML ...
- 转贴:PLSQL中 commit 和 rollback 的区别
PLSQL中 commit 和 rollback 的区别 原文链接:https://blog.csdn.net/jerrytomcat/article/details/82250915 一. comm ...
- 【SQL系列】从SQL语言的分类谈COMMIT和ROLLBACK的用法
公众号:SAP Technical 本文作者:matinal 原文出处:http://www.cnblogs.com/SAPmatinal/ 原文链接:[SQL系列]从SQL语言的分类谈COMMIT和 ...
随机推荐
- h5微信支付在微信内页使用微信公众号支付
由于app的迭代,原本的微信支付是使用原生写的 然后h5这边做交互,现在需要修改使用h5的微信支付,于是就有了现在的这个例子,微信支付其实对于我们前端来说就是调用接口然后,根据链接进行支付,其中有点坑 ...
- 函数调用模式,this指向
## 函数的四种调用模式 1.函数模式 this--->window function test(){ console.log(this); } test(): 2.方法模式 thi ...
- Matlab内嵌图像
在数值分析中我们通常需要将数据可视化成图像的形式作为我们分析结果的有效性的途径,常用的画图函数有:$\tt plot$,$\tt surf$,$\tt mesh$...当然,我们有时需要多窗口显示图像 ...
- IDEA(添加类注释以及方法注释)
添加类注释: File---Setting----Editor----Code Style-----File and Code Templates--------Class #if (${PA ...
- C#中,子类构造函数调用父类父类构造函数的正确方式
正确调用的方式是:
- 软件测试第一次试验JUnit
一.Junit, hamcrest以及eclemma的安装 对于Junit和hamcrest的安装,我并没有从下载Junit和hamcrest相关的jar包然后通过build path导入到项目中,而 ...
- cordova/phonegap/webapp性能优化方法
1.有条件可以自己做UI,不要用框架.用框架的话不要用jquery mobile,用sencha touch或者jqmobi(app framework) 2.不要在服务器生成UI,在本地生成. 3. ...
- CSS3-3
关于背景 一. 渐变&径向渐变(background-image: -webkit-linear-gradient() && background-image: -webkit ...
- OpenStack的容器服务体验
magnum 是用于 OpenStack 的容器服务.它有以下特点: 抽象的容器.节点.服务等 集成了用于容器技术的 Kubernetes 和 Docker 集成了多租户安全的 Keystone 继承 ...
- windwos安装docker步骤
参考 https://www.linuxidc.com/Linux/2016-07/133506.htm