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:

  1. TM asks TC to begin a new global transaction. TC generates an XID representing the global transaction.
  2. XID is propagated through microservices' invoke chain.
  3. RM register local transaction as a branch of the corresponding global transaction of XID to TC.
  4. TM asks TC for committing or rollbacking the corresponding global transaction of XID.
  5. 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的更多相关文章

  1. JDBC Tutorials: Commit or Rollback transaction in finally block

    http://skeletoncoder.blogspot.com/2006/10/jdbc-tutorials-commit-or-rollback.html JDBC Tutorials: Com ...

  2. mysql事务,START TRANSACTION, COMMIT和ROLLBACK,SET AUTOCOMMIT语法

    http://yulei568.blog.163.com/blog/static/135886720071012444422/ MyISAM不支持 START TRANSACTION | BEGIN ...

  3. 14.5.2.2 autocommit, Commit, and Rollback

    14.5.2.2 autocommit, Commit, and Rollback 在InnoDB,所有的用户活动发生在一个事务里, 如果自动提交模式是启用的, 每个SQL语句形成一个单独的事务.默认 ...

  4. 14.3.2.2 autocommit, Commit, and Rollback 自动提交 提交和回滚

    14.3.2.2 autocommit, Commit, and Rollback 自动提交 提交和回滚 如果自动提交模式被启用,在InnoDB里, 所有的用户活动发生在一个事务里, 每个SQL语句 ...

  5. 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) { ...

  6. 说commit,rollback

    事务执行失败后,看做的是commit还是rollback:commit是把执行成功的部分提交了,rollback就是全回滚了.如果rollback失败了,此时不处理,等到客户端断开,MySQL内部默认 ...

  7. oracle 基础知识(五)--回滚(commit和rollback)

    一,commit 01,commit干了啥 commit 就是提交的意思.也就是当你把99%的东西都做好了,然后你执行最后一步的操作...再commit前的话你可能啪啪啪啪啪,敲了几百条sql DML ...

  8. 转贴:PLSQL中 commit 和 rollback 的区别

    PLSQL中 commit 和 rollback 的区别 原文链接:https://blog.csdn.net/jerrytomcat/article/details/82250915 一. comm ...

  9. 【SQL系列】从SQL语言的分类谈COMMIT和ROLLBACK的用法

    公众号:SAP Technical 本文作者:matinal 原文出处:http://www.cnblogs.com/SAPmatinal/ 原文链接:[SQL系列]从SQL语言的分类谈COMMIT和 ...

随机推荐

  1. Petrozavodsk Winter Camp, Warsaw U, 2014, A The Carpet

    一个地图上有若干障碍,问允许出现一个障碍的最大子矩形为多大? 最大子矩形改编 #include<bits/stdc++.h> using namespace std; #define re ...

  2. php代码审计——DVWA

    1.命令注入: LOW等级: 输入没有任何限制,可以直接ping: Medium等级: 介绍一下str_replace()函数和array_key()函数: Str_replace(str1,str2 ...

  3. java 删除整数元素集合中的元素

    1. 简介 对于整数类型的元素集合,例如{1, 2, 3, 4, 5},再进行元素删除时需要注意.在List中删除操作有remove(int index)和remove(Object o), 查看两种 ...

  4. 网盘资源分享:你不知道的JavaScript(上)

    链接:https://pan.baidu.com/s/1UEBetOr2Z94oEeu5VsQYXQ 提取码:etts 复制这段内容后打开百度网盘手机App,操作更方便哦

  5. day 05字典相关内容

    1.day 04内容回顾及作业讲解 列表:增 append insert extend 删 remove pop clear del 改 li[索引]='被修改的内容' li[切片]='被修改的内容' ...

  6. maven将依赖的jar包复制到指定位置

    <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> ...

  7. PDF 补丁丁 0.6.0.3355 版发布(修复阅读模式、书签缩放的问题)

    PDF补丁丁的新版本修复了染色阅读模式失效.编辑器书签缩放比例调整在某些场合下失败的问题.

  8. 初学web前端

    菜鸟刚入门,说说最近学习的心得吧. 首先我学前端主要是因为前端可以看到一些东西,比较有趣 好玩.相比其他语言更简单一些 ,但是却没有那么枯燥. 刚刚开始学习前端肯定就是html+css了.我是混着学的 ...

  9. python全栈开发笔记---------函数

    一 数学定义的函数与python中的函数 初中数学函数定义:一般的,在一个变化过程中,如果有两个变量x和y,并且对于x的每一个确定的值,y都有唯一确定的值与其对应,那么我们就把x称为自变量,把y称为因 ...

  10. 页面显示LCD液晶字体或者其他特殊字体

    如果web项目中需要用到LCD液晶字体显示数值(如下图所示)该怎么办? 在这就需要用到@font-face(具体看一下语法) /* 定义 */ @font-face { font-family: 'M ...