当前位置:网站首页>Redis transaction implements optimistic locking principle
Redis transaction implements optimistic locking principle
2022-04-23 07:59:00 【Dream river dream】
Transaction implementation
1)multi Pass before order watch Command monitor key;
2) perform multi command ;
3) The list of commands ;
4)exec Order to commit a transaction /discard Command rollback ;
watch Implementation principle of
1)redis Maintain a global watch_keys, Also a <key,value> structure ,key yes key+“&&”+ Connect id, It means that the client connection wants to listen to this key,value yes key Version number of , Every time you modify this key, Version number will be incremented .
2) When executed exec When ordered , Will execute every command in the transaction queue , When executing a write command , Will check the current key Does it exist in watch_keys in , If there is , It will check whether the version numbers of the two are equal , If equal, execute this write command , If they are not equal, no information is returned , Then delete watch_keys Corresponding to key;
版权声明
本文为[Dream river dream]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230629085697.html
边栏推荐
- The problem of exporting excel form with wireframe and internal spacing of form by using web form
- KCD_ EXCEL_ OLE_ TO_ INT_ Convert reports an error sy subrc = 2
- 第七章 资产减值
- How to present your digital portfolio: suggestions from creative recruiters
- FUEL: Fast UAV Exploration using Incremental Frontier Structure and Hierarchical Planning
- MySQL in window10 version does not work after setting remote access permission
- What's new in. Net 5 NET 5
- Suggestions on university learning route planning
- 读取修改resource文件夹下的json文件
- Reptile learning notes, learning reptile, read this article is enough
猜你喜欢
MySQL in window10 version does not work after setting remote access permission
[NLP notes] preliminary study on CRF principle
Simplify exporting to SVG data files and all images in SVG folder
[unity VFX] Introduction notes of VFX special effects - spark production
Houdini>流体,刚体导出学习过程笔记
Common markdown grammar learning
STO With Billing 跨公司库存转储退货
Export all SVG files in the specified path into pictures in PNG format (thumbnail or original size)
CTF攻防世界刷题51-
VBA appelle SAP RFC pour réaliser la lecture et l'écriture des données
随机推荐
VBA appelle SAP RFC pour réaliser la lecture et l'écriture des données
Intranet penetration series: icmptunnel of Intranet tunnel (by master dhavalkapil)
庄懂的TA笔记(六)<FakeEnvReflect && 生锈,锈迹效果>
一些靶场的学习记录:sqli-labs、upload-labs、XSS
MySQL8. 0 installation / uninstallation tutorial [window10 version]
Gets the maximum getmaxpoint in the list of all points
内网渗透系列:内网隧道之dnscat2
企业微信免登录跳转自建应用
Internal network security attack and defense: a practical guide to penetration testing (5): analysis and defense of horizontal movement in the domain
Simplify exporting to SVG data files and all images in SVG folder
C smoothprogressbar custom progress bar control
内网渗透系列:内网隧道之icmptunnel(jamesbarlow师傅的)
Nodejs (VI) sub process operation
Apache Hudi 如何加速传统的批处理模式?
A programmer who works four hours a day
CTF-MISC学习之从开始到放弃
Unity C# 单例模式 学习复习笔记
常用Markdown语法学习
Houdini流体>>粒子流体导出到unity笔记
Mongodb starts warning information processing