当前位置:网站首页>Distributed transaction
Distributed transaction
2022-07-03 02:53:00 【Xiaobai wants to become a big cow】
The transaction ACID principle
A(Atomicity): Atomicity : All operations of the transaction , All or nothing , All or nothing
C(Consistency): Uniformity : To ensure the internal integrity of the database , Declarative constraints
I(Isolation): Isolation, : Transactions operating on the same resource cannot occur at the same time
D(Durability): persistence : On the database All modifications will be permanently saved , Whether or not there is a fault
Micro service case
Micro service ordering business , When placing an order, the order service will be called , Create an order and write it to the database .
Then the order service invokes the account service and the inventory service :
• The account service is responsible for deducting the user's balance
• Inventory service is responsible for deducting inventory of goods 
But if the order microservices and account microservices operate the database, there is no problem , But when it comes to the inventory micro service, the inventory is insufficient , Then the inventory microservice will definitely operate, and the microservice will fail . What do you do then ? Ordinary transactions cannot listen to remotely invoked account services and inventory services ,@Transactional Is the use of the AOP To achieve , Enhanced our approach , Post enhancement is used. If there is an error, rollback the transaction , But we can't operate remote account service and inventory service , Because every micro service is independent , You can only access the open interface in the microservice and cannot operate it
CAP theory
C(Consistency): Uniformity A(Availability): Usability P(Partition tolerance): Partition tolerance
These three indicators cannot be met in distributed systems
边栏推荐
- Xiaodi notes
- How to select the minimum and maximum values of columns in the data table- How to select min and max values of a column in a datatable?
- Joking about Domain Driven Design (III) -- Dilemma
- SqlServer行转列PIVOT
- 怎么将yolov5中的PANet层改为BiFPN
- yii2 中andWhere多个or查询 orm条件
- What is the way out for children from poor families?
- 【富瀚6630编码存录像,用rtsp服务器及时间戳同步实现vlc观看录像】
- Error when installing MySQL in Linux: starting mysql The server quit without updating PID file ([FAILED]al/mysql/data/l.pid
- [translation] flux is safe. Gain more confidence through fuzzy processing
猜你喜欢
![[fluent] listview list (map method description of list set | vertical list | horizontal list | code example)](/img/e5/c01f760b07b495f5b048ea367e0c21.gif)
[fluent] listview list (map method description of list set | vertical list | horizontal list | code example)

Three.js本地环境搭建

HW initial preparation

基于can总线的A2L文件解析(2)
![[Hcia]No.15 Vlan间通信](/img/59/a467c5920cbccb72040f39f719d701.jpg)
[Hcia]No.15 Vlan间通信

C语言初阶-指针详解-庖丁解牛篇

用docker 連接mysql的過程

迅雷chrome扩展插件造成服务器返回的数据js解析页面数据异常

Joking about Domain Driven Design (III) -- Dilemma

Kubernetes cluster log and efk architecture log scheme
随机推荐
As a leader, how to control the code version and demand development when the epidemic comes| Community essay solicitation
Error invalid bound statement (not found): com ruoyi. stock. mapper. StockDetailMapper. XXXX solution
Two dimensional format array format index subscript continuity problem leads to return JSON format problem
Le processus de connexion mysql avec docker
错误Invalid bound statement (not found): com.ruoyi.stock.mapper.StockDetailMapper.xxxx解决
Mathematical statistics -- Sampling and sampling distribution
What does it mean when lambda is not entered?
vfork执行时出现Segmentation fault
Getting started | jetpack hilt dependency injection framework
Unity3d human skin real time rendering real simulated human skin real time rendering "suggestions collection"
MATLAB小技巧(24)RBF,GRNN,PNN-神经网络
How to change the panet layer in yolov5 to bifpn
sql server 查询指定表的表结构
Yiwen takes you to know ZigBee
【翻译】具有集中控制平面的现代应用负载平衡
I2C 子系统(一):I2C spec
"Analysis of 43 cases of MATLAB neural network": Chapter 43 efficient programming skills of neural network -- Discussion Based on the characteristics of the new version of MATLAB r2012b
Andwhere multiple or query ORM conditions in yii2
函数栈帧的创建与销毁
Pytest (6) -fixture (Firmware)