当前位置:网站首页>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
边栏推荐
- Super easy to use logzero
- 疫情当头,作为Leader如何进行代码版本和需求开发管控?| 社区征文
- Two dimensional format array format index subscript continuity problem leads to return JSON format problem
- Check log4j problems using stain analysis
- 内存泄漏工具VLD安装及使用
- [fluent] futurebuilder asynchronous programming (futurebuilder construction method | asyncsnapshot asynchronous calculation)
- Kubernetes family container housekeeper pod online Q & A?
- ASP. Net core 6 framework unveiling example demonstration [02]: application development based on routing, MVC and grpc
- [shutter] bottom navigation bar page frame (bottomnavigationbar bottom navigation bar | pageview sliding page | bottom navigation and sliding page associated operation)
- Segmentation fault occurs during VFORK execution
猜你喜欢

SQL statement

Baidu map - surrounding search

超好用的日志库 logzero

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

Add some hard dishes to the interview: how to improve throughput and timeliness in delayed task scenarios!
![[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)](/img/6a/ae44ddb090ce6373f04a550a15f973.jpg)
[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)

xiaodi-笔记

Error invalid bound statement (not found): com ruoyi. stock. mapper. StockDetailMapper. XXXX solution

Thunderbolt Chrome extension caused the data returned by the server JS parsing page data exception

Deep reinforcement learning for intelligent transportation systems: a survey paper reading notes
随机推荐
Introduction to cron expression
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?
[shutter] banner carousel component (shutter_wiper plug-in | swiper component)
Cancer biopsy instruments and kits - market status and future development trends
错误Invalid bound statement (not found): com.ruoyi.stock.mapper.StockDetailMapper.xxxx解决
Notifydatasetchanged not applicable to recyclerview - notifydatasetchanged not working on recyclerview
[principles of multithreading and high concurrency: 1_cpu multi-level cache model]
Mathematical statistics -- Sampling and sampling distribution
Joking about Domain Driven Design (III) -- Dilemma
I2C 子系统(一):I2C spec
基于can总线的A2L文件解析(2)
The solution of "the required function is not supported" in win10 remote desktop connection is to modify the Registry [easy to understand]
C语言初阶-指针详解-庖丁解牛篇
Classes and objects - initialization and cleanup of objects - constructor call rules
Use optimization | points that can be optimized in recyclerview
The difference between left value and right value in C language
Global and Chinese ammonium dimolybdate market in-depth analysis and prospect risk prediction report 2022 Edition
Three. JS local environment setup
Yiwen takes you to know ZigBee
[shutter] bottom navigation bar page frame (bottomnavigationbar bottom navigation bar | pageview sliding page | bottom navigation and sliding page associated operation)