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. Django-models & QuerySet API

    django中配置mysql数据库 1,首先配置settings.py. 一是在INSTALLED_APPS里面加入app名称: 二是配置数据库相关信息 INSTALLED_APPS = [ 'dja ...

  2. Linux压缩与解压缩文件

    1 将tgz文件解压到指定目录. tar zxvf test.tgz -C 指定目录 比如:将 test.tgz 解压到 /home目录:tar zxvf test.tgz -C /home 2 将指 ...

  3. Tensorflow 报错:tensorflow.python.framework.errors_impl.InternalError: Failed to create session.

    问题描述 IDE:pycharm,环境中安装tensorflow-gpu 1.8.0 ,Cuda9 ,cudnn 7,等,运行代码 报错如下 tensorflow.python.framework.e ...

  4. MACE移植要求

    MACE支持Tensorflow的depth_to_space和space_to_depth,以及strided_slice算子. 其中depth_to_space可以用来无平滑地进行上采样. spa ...

  5. 文科生打开python的大门

    作为唯一的一名教育学院的学生,加入python课程,一定要声明我可不是并不是被迫选课的!虽然是文科生,但是是对编程这种东西很感兴趣的文科生.从站在python门口的张望,到现在悄悄把门打开,越来越感觉 ...

  6. sql server中如何修改视图中的数据?

    sql server中如何修改视图中的数据? 我做个测试,视图的数据有标记字段时,如果是这种方式(0 as FlagState),是无法修改的 --创建视图语句 --- create view V_E ...

  7. Surface RT2使用情况

    Surface RT2是一个6年的古董了,暂时还能使用的功能包括但不限于一些xbox小游戏,ppt阅读(加载慢),pdf阅读(加载慢),word阅读. 2018/6/16 爱奇艺关闭了大部分win8R ...

  8. Qt 分页标题打印

    void ItemSplitter::printpdf(const QString& fileName){ QPrinter printer_html(QPrinter::ScreenReso ...

  9. Python列表操作集合

    对于python列表里元素的操作主要分为以下几个方面: 1.向列表里面加元素: 向python列表里面添加元素主要有三种方法: (1)append() append()对于列表的操作主要实现的是在特定 ...

  10. css3动画怎样能从下往上慢慢升上去

    <!DOCTYPE html><html><head> <style> div { width:100px; height:100px; backgro ...