当前位置:网站首页>分布式事务
分布式事务
2022-07-03 02:52:00 【小白要变大牛】
事务的ACID原则
A(Atomicity):原子性:事务的所有操作,要么全部成功,要么全部失败
C(Consistency):一致性:要保证数据库内部完整性约束,声明性约束
I(Isolation):隔离性:对同一资源操作的事务不能同时发生
D(Durability):持久性:对数据库做的 一切修改将永久保存,不管是否出现故障
微服务案例
微服务下单业务,在下单时会调用订单服务,创建订单并且写入数据库。
然后订单服务调用账户服务和库存服务:
•账户服务负责扣减用户余额
•库存服务负责扣减商品库存 
但是如果订单微服务呵账户微服务都操作数据库没问题,但是到了库存微服务这里库存不足,那么库存微服务肯定是会操作微服务是失败的 。这时候怎么办呢?普通的事务是监听不到远程调用的账户服务和库存服务的,@Transactional是使用了AOP来实现的,增强了我们的方法,使用了后置增强如果出错了就回滚事务,但是远程的账户服务和库存服务我们是操作不了的,因为每个微服务都是独立的,只能访问微服务中开放出来的接口而不能操作它
CAP理论
C(Consistency):一致性 A(Availability):可用性 P(Partition tolerance):分区容错性
分布式系统中无法满足这三个指标
边栏推荐
- 搭建私有云盘 cloudreve
- Interview stereotyped version
- Gbase 8C system table PG_ attribute
- Introduction to cron expression
- Matlab tips (24) RBF, GRNN, PNN neural network
- 【富瀚6630编码存录像,用rtsp服务器及时间戳同步实现vlc观看录像】
- Sous - système I2C (IV): débogage I2C
- Error when installing MySQL in Linux: starting mysql The server quit without updating PID file ([FAILED]al/mysql/data/l.pid
- Deep reinforcement learning for intelligent transportation systems: a survey paper reading notes
- I2C 子系统(二):I3C spec
猜你喜欢
![[shutter] setup of shutter development environment (supplement the latest information | the latest installation tutorial on August 25, 2021)](/img/65/c1fe95f8c391394f7ff1b75c7d75b6.jpg)
[shutter] setup of shutter development environment (supplement the latest information | the latest installation tutorial on August 25, 2021)

I2C 子系统(三):I2C Driver

Can netstat still play like this?

Deep learning: multi-layer perceptron and XOR problem (pytoch Implementation)

【Flutter】shared_ Preferences local storage (introduction | install the shared_preferences plug-in | use the shared_preferences process)

What is the way out for children from poor families?

Today, it's time to copy the bottom!

sql server数据库添加 mdf数据库文件,遇到的报错
![[Hcia]No.15 Vlan间通信](/img/59/a467c5920cbccb72040f39f719d701.jpg)
[Hcia]No.15 Vlan间通信

I2C 子系統(四):I2C debug
随机推荐
[shutter] setup of shutter development environment (supplement the latest information | the latest installation tutorial on August 25, 2021)
Kubernetes cluster log and efk architecture log scheme
Check log4j problems using stain analysis
Practice of traffic recording and playback in vivo
Concrete CMS vulnerability
函数栈帧的创建与销毁
Thunderbolt Chrome extension caused the data returned by the server JS parsing page data exception
Build a private cloud disk cloudrev
What is the way out for children from poor families?
[C language] MD5 encryption for account password
Your family must be very poor if you fight like this!
Gbase 8C function / stored procedure parameters (II)
The solution of "the required function is not supported" in win10 remote desktop connection is to modify the Registry [easy to understand]
vfork执行时出现Segmentation fault
当lambda没有输入时,是何含义?
Tensorflow to pytorch notes; tf. gather_ Nd (x, y) to pytorch
HW initial preparation
Gbase 8C system table PG_ amproc
Source code analysis | layout file loading process
Kubernetes family container housekeeper pod online Q & A?