当前位置:网站首页>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
边栏推荐
- Segmentation fault occurs during VFORK execution
- C语言初阶-指针详解-庖丁解牛篇
- Strategy application of Dameng database
- The difference between left value and right value in C language
- 【翻译】后台项目加入了CNCF孵化器
- Deep learning: multi-layer perceptron and XOR problem (pytoch Implementation)
- 函数栈帧的创建与销毁
- [shutter] banner carousel component (shutter_wiper plug-in | swiper component)
- js根据树结构查找某个节点的下面的所有父节点或者子节点
- [translation] modern application load balancing with centralized control plane
猜你喜欢

超好用的日志库 logzero

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

"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

What does "where 1=1" mean

定了,就选它

I2C 子系统(二):I3C spec

一文带你了解 ZigBee

Matlab tips (24) RBF, GRNN, PNN neural network

HTB-Devel

Today, it's time to copy the bottom!
随机推荐
Error invalid bound statement (not found): com ruoyi. stock. mapper. StockDetailMapper. XXXX solution
Introduction to cron expression
Installation and use of memory leak tool VLD
Privatization lightweight continuous integration deployment scheme -- 01 environment configuration (Part 2)
Kubernetes family container housekeeper pod online Q & A?
Random Shuffle attention
用docker 連接mysql的過程
xiaodi-笔记
How to implement append in tensor
当lambda没有输入时,是何含义?
The process of connecting MySQL with docker
Sous - système I2C (IV): débogage I2C
[principles of multithreading and high concurrency: 1_cpu multi-level cache model]
Three.js本地环境搭建
Deep reinforcement learning for intelligent transportation systems: a survey paper reading notes
HTB-Devel
Counter统计数量后,如何返回有序的key
Wechat - developed by wechat official account Net core access
《MATLAB 神经网络43个案例分析》:第43章 神经网络高效编程技巧——基于MATLAB R2012b新版本特性的探讨
Source code analysis | resource loading resources