当前位置:网站首页>分布式事务TCC浅析
分布式事务TCC浅析
2022-06-28 01:10:00 【May Hacker】
前言
之前学习过分布式事务中,有2PC、3PC协议。
TCC也是实现分布式事务的一种方式/协议,阿里开源的seata分布式事务中间件就支持TCC模式。
TCC介绍
TCC 指的是Try - Confirm - Cancel。
- Try 指的是预留,即资源的预留和锁定,注意是预留。
- Confirm 指的是确认操作,这一步其实就是真正的执行了。
- Cancel 指的是撤销操作,可以理解为把预留阶段的动作撤销了。
其实从思想上看和 2PC 差不多,都是先试探性的执行,如果都可以那就真正的执行,如果不行就回滚。
注意
值得注意的是,TCC中的三板斧方法需要业务方自己实现逻辑,比较难。
实现TCC逻辑的时候,需要注意幂等支持,因为在Confirm和Cancel的时候可能会出现重试。
边栏推荐
- [today in history] June 25: the father of notebook was born; Windows 98 release; First commercial use of generic product code
- 把腾讯搬上云:云服务器 CVM 的半部进化史
- STM32的C语言与汇编语言混合编程
- SQL reported an unusual error, which confused the new interns
- How to realize red, green and yellow traffic lights in ros+gazebo?
- 抓包整理外篇fiddler————了解工具栏[一]
- 【方块编码】基于matlab的图像方块编码仿真
- Mysql数据库基础:DML数据操作语言
- Raspberry pie - environment settings and cross compilation
- How to run unity webgl after packaging (Firefox configuration)
猜你喜欢

Desai wisdom number - histogram (column folding mixed graph): ratio of rental price to rental income in the graduation quarter of 2021

【倒立摆控制】基于UKF无迹卡尔曼滤波的倒立摆控制simulink仿真

Get 5 offers after being notified of layoffs

【历史上的今天】6 月 7 日:Kubernetes 开源版本发布;《魔兽世界》登陆中国;分组交换网络发明者出生

Usage differences between isempty and isblank
![[2D code image correction and enhancement] simulation of 2D code image correction and enhancement processing based on MATLAB](/img/d8/a367c26b51d9dbaf53bf4fe2a13917.png)
[2D code image correction and enhancement] simulation of 2D code image correction and enhancement processing based on MATLAB

【历史上的今天】5 月 29 日:共享软件先驱诞生;ChromeBox 推出;VoodooPC 创始人出生
![[today in history] June 7: kubernetes open source version was released; Worldofwarcraft landed in China; Birth of the inventor of packet switching network](/img/70/6864b41e17502ec391db23ae83bd4b.png)
[today in history] June 7: kubernetes open source version was released; Worldofwarcraft landed in China; Birth of the inventor of packet switching network
![[today in history] June 16: Oracle Bone Inscriptions was established; Microsoft MSX was born; The inventor of fast Fourier transform was born](/img/4f/67e1598b523058a8fb6f3148136902.png)
[today in history] June 16: Oracle Bone Inscriptions was established; Microsoft MSX was born; The inventor of fast Fourier transform was born

【历史上的今天】6 月 1 日:Napster 成立;MS-DOS 原作者出生;谷歌出售 Google SketchUp
随机推荐
isEmpty 和 isBlank 的用法区别
Résumé de la graduation
Writing C program with GCC and makefile for the first time
Win11 ne peut pas faire glisser l'image sur le logiciel de la barre des tâches
树莓派-环境设置和交叉编译
【历史上的今天】6 月 8 日:万维网之父诞生;PHP 公开发布;iPhone 4 问世
【历史上的今天】6 月 6 日:世界 IPv6 启动纪念日;《俄罗斯方块》发布;小红书成立
Is it safe for qiniu to open an account? How do I open an account online?
畢業總結
字节跳动面试官:一张图片占据的内存大小是如何计算
SQL reported an unusual error, which confused the new interns
Raspberry pie - environment settings and cross compilation
What if win11 can't drag an image to the taskbar software to open it quickly
横向滚动的RecycleView一屏显示五个半,低于五个平均分布
Usage details of staticlayout
Mysql数据库基础:DML数据操作语言
如何判断线程池已经执行完所有任务了?
StaticLayout的使用详解
【历史上的今天】6 月 5 日:洛夫莱斯和巴贝奇相遇;公钥密码学先驱诞生;函数语言设计先驱出生
Différences d'utilisation entre IsEmpty et isblank