当前位置:网站首页>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
边栏推荐
- 用docker 连接mysql的过程
- How to implement append in tensor
- Can netstat still play like this?
- 【翻译】Flux安全。通过模糊处理获得更多信心
- Pytest (6) -fixture (Firmware)
- Thunderbolt Chrome extension caused the data returned by the server JS parsing page data exception
- Counter统计数量后,如何返回有序的key
- [shutter] bottom navigation bar page frame (bottomnavigationbar bottom navigation bar | pageview sliding page | bottom navigation and sliding page associated operation)
- Gbase 8C system table PG_ auth_ members
- Source code analysis | resource loading resources
猜你喜欢

【翻译】后台项目加入了CNCF孵化器

Three.js本地环境搭建

Random Shuffle attention

分布式事务

What does "where 1=1" mean

C language beginner level - pointer explanation - paoding jieniu chapter

I2C 子系統(四):I2C debug

怎么将yolov5中的PANet层改为BiFPN

Didi programmers are despised by relatives: an annual salary of 800000 is not as good as two teachers

Check log4j problems using stain analysis
随机推荐
Gbase 8C trigger (II)
迅雷chrome扩展插件造成服务器返回的数据js解析页面数据异常
The left value and the right finger explain better
Choose it when you decide
Add some hard dishes to the interview: how to improve throughput and timeliness in delayed task scenarios!
Serious security vulnerabilities reported by moxa mxview network management software
[principles of multithreading and high concurrency: 1_cpu multi-level cache model]
The process of connecting MySQL with docker
[hcia]no.15 communication between VLANs
Can netstat still play like this?
[flutter] example of asynchronous programming code between future and futurebuilder (futurebuilder constructor setting | handling flutter Chinese garbled | complete code example)
ASP. Net core 6 framework unveiling example demonstration [02]: application development based on routing, MVC and grpc
What does "where 1=1" mean
Principle and application of database
Sqlserver row to column pivot
[translation] modern application load balancing with centralized control plane
二维格式数组格式索引下标连续问题导致 返回json 格式问题
The difference between left value and right value in C language
Classes and objects - initialization and cleanup of objects - constructor call rules
Practice of traffic recording and playback in vivo