当前位置:网站首页>Redis transaction
Redis transaction
2022-07-04 02:21:00 【Drgom】
redis Business Complete... Is not supported acid Mechanism ,redis The process of transaction is divided into team formation and execution , An error occurred in a command in the process of forming a team , Then all errors are reported , An error occurred during execution , Still carry on , In addition to executing failed commands , Carry on , No, Transaction isolation level The concept of

Locking mechanism
Here is to redis Based on a single server , Lock is divided into optimistic lock and pessimistic lock
Optimism lock
Optimistic locks are distinguished by version numbers ,redis Transaction monitoring key, If I found key The version number before and after changes , Then the transaction execution fails , and redis The lock of a transaction is an optimistic lock
Pessimistic locking
Nothing to say. , Total occlusion , Native redis Can't achieve

Monitor one at a time key, Open two transactions , When the transaction is executed key Version number of changed , Then the transaction execution fails
Defects of two locking mechanisms
Optimism lock : In a highly concurrent environment , It will lead to inventory problems ( Because of the high concurrency key The version of is modified by multiple transactions , Therefore, the competition will lead to the failure of transaction execution )
Pessimistic locking : Insufficient concurrency
边栏推荐
- [Yugong series] February 2022 attack and defense world advanced question misc-84 (MySQL)
- Sequence sorting of basic exercises of test questions
- 2022 R2 mobile pressure vessel filling certificate examination and R2 mobile pressure vessel filling simulation examination questions
- Advanced learning of MySQL -- Application -- index
- Mysql to PostgreSQL real-time data synchronization practice sharing
- Jerry's modification setting status [chapter]
- 在尋求人類智能AI的過程中,Meta將賭注押向了自監督學習
- Remote work guide
- ZABBIX API batch delete a template of the host
- Solve the problem that the tabbar navigation at the bottom of vantui does not correspond to the page (window.loading.hash)
猜你喜欢

VRRP+BFD

On Valentine's day, I code a programmer's exclusive Bing Dwen Dwen (including the source code for free)

Node solves cross domain problems

Iclr2022 | ontoprotein: protein pre training integrated with gene ontology knowledge

Network communication basic kit -- IPv4 socket structure

Remember another interview trip to Ali, which ends on three sides

Small program graduation design is based on wechat order takeout small program graduation design opening report function reference

Crawler practice website image batch download

C language black Technology: Archimedes spiral! Novel, interesting, advanced~

SQL statement
随机推荐
12. Gettimeofday() and time()
Gee import SHP data - crop image
How to subcontract uniapp and applet, detailed steps (illustration) # yyds dry goods inventory #
Hamburg University of Technology (tuhh) | intelligent problem solving as integrated hierarchical reinforcement learning
13. Time conversion function
Idea if a class cannot be found, it will be red
Format character%* s
Global and Chinese market of digital impression system 2022-2028: Research Report on technology, participants, trends, market size and share
Global and Chinese market of thin film deposition systems 2022-2028: Research Report on technology, participants, trends, market size and share
In yolov5, denselayer is used to replace focus, and the FPN structure is changed to bi FPN
Solve the problem that the tabbar navigation at the bottom of vantui does not correspond to the page (window.loading.hash)
Network communication basic kit -- IPv4 socket structure
Take you to master the formatter of visual studio code
The automatic control system of pump station has powerful functions and diverse application scenarios
G3 boiler water treatment registration examination and G3 boiler water treatment theory examination in 2022
Conditional statements of shell programming
Intel's new GPU patent shows that its graphics card products will use MCM Packaging Technology
Portable two-way radio equipment - current market situation and future development trend
LV1 Roche limit
Reading notes - learn to write: what is writing?