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和 ...
随机推荐
- jQuery 让input里面的内容可以布局到页面上
<div id="selectBox"> </div> <div class="make"> <span class= ...
- 规则引擎 - (三)BOM工程(上)
建工程并关联xom工程 1.新建——>项目——>规则项目——>标准规则项目. 项目命名,下一步. 在xom设置中选择之前建好的xom工程,下一步. 工程没用到xsd,不选择,下一步. ...
- background-size cover和contain的用法详解
我们还可以通过background-size来控制背景图片的尺寸. background-size有几个属性值,常用的是cover和contain.那么background-size:cover和co ...
- hdu多校第4场E. Matrix from Arrays HDU 二维前缀和
Problem E. Matrix from Arrays Time Limit: / MS (Java/Others) Memory Limit: / K (Java/Others) Total S ...
- 三星I939D手机刷机记录
三星I939D刷机经过 2017.10.21 ===================== 之前手机的Recovery已经升级过了. 由于一直没有找到原版的升级包,而网上的升级包几乎没有一个干净的,垃圾 ...
- Python爬取qq空间说说
#coding:utf-8 #!/usr/bin/python3 from selenium import webdriver import time import re import importl ...
- failed call to cuInit: CUDA_ERROR_NO_DEVICE: no CUDA-capable device is detected 排坑指南
训练maskrcnn时,出现了 failed call to cuInit: CUDA_ERROR_NO_DEVICE: no CUDA-capable device is detected 一开始以 ...
- Django框架教程之正则表达式URL误区详解
问题:我学习的视频大概是2015年录的,里面用的Django版本比较老关于正则表达式URL这一块都是用的url(“url(r'^admin/', admin.site.urls),”)方法.而我自己练 ...
- 关于JS 的cookie 操作 与 json 的数据结构 问题
今天写了一个购物车,由于购物车内容是保存在 cookie中 所以不想浪费服务器资源做cookie的操作 故在前端封装了一些对象来处理购物车,由于cookie的数据结构的设计是一个json格式 使用 账 ...
- git pull提交代码遇到的问题
git pull 提示如下错误 解决方法: git pull 后面加上分支具体地址 比如:git pull origin daily/1.0.0 同样git push origin daily/1. ...