当前位置:网站首页>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
边栏推荐
- 搭建私有云盘 cloudreve
- Apple releases MacOS 11.6.4 update: mainly security fixes
- Three. JS local environment setup
- Basic operation of binary tree (C language version)
- I2C subsystem (III): I2C driver
- [C language] MD5 encryption for account password
- 错误Invalid bound statement (not found): com.ruoyi.stock.mapper.StockDetailMapper.xxxx解决
- SQL Server Query spécifie la structure de la table
- Installation and use of memory leak tool VLD
- Random shuffle note
猜你喜欢
The Linux server needs to install the agent software EPS (agent) database
xiaodi-笔记
Pytest (6) -fixture (Firmware)
I2C subsystem (IV): I2C debug
[translation] modern application load balancing with centralized control plane
Linear rectification function relu and its variants in deep learning activation function
Mathematical statistics -- Sampling and sampling distribution
Sqlserver row to column pivot
Xiaodi notes
定了,就选它
随机推荐
用docker 连接mysql的过程
Use cve-2021-43893 to delete files on the domain controller
[hcia]no.15 communication between VLANs
where 1=1 是什么意思
Deep learning: multi-layer perceptron and XOR problem (pytoch Implementation)
I2C 子系统(二):I3C spec
What does it mean when lambda is not entered?
The process of connecting MySQL with docker
sql server 查询指定表的表结构
random shuffle注意
左值右指解释的比较好的
js根据树结构查找某个节点的下面的所有父节点或者子节点
Getting started | jetpack hilt dependency injection framework
The difference between left value and right value in C language
Notifydatasetchanged not applicable to recyclerview - notifydatasetchanged not working on recyclerview
[Hcia]No.15 Vlan间通信
[fluent] JSON model conversion (JSON serialization tool | JSON manual serialization | writing dart model classes according to JSON | online automatic conversion of dart classes according to JSON)
tensor中的append应该如何实现
Today, it's time to copy the bottom!
I2C 子系统(三):I2C Driver