当前位置:网站首页>Optimistic lock pessimistic lock applicable scenario
Optimistic lock pessimistic lock applicable scenario
2022-07-25 18:02:00 【Leon_ Jinhai_ Sun】
From the attitude towards the lock, if the lock , Lock can be divided into optimistic lock and pessimistic lock , It can also be seen from the name that these two kinds of locks are treated in two ways Thinking mode of data concurrency . It should be noted that , Optimism and pessimism are not locks , It's locked design idea .
From the design ideas of these two kinds of locks , Let's summarize the applicable scenarios of optimistic lock and pessimistic lock :
1. Optimism lock fit There are many reading operations Scene , Relatively speaking, there are fewer operations to write . Its advantage lies in Program realization , There is no deadlock problem , But the applicable scenario will also be relatively optimistic , Because it can't stop database operations other than programs .
2. Pessimistic locking fit There are many writing operations Scene , Because the write operation has Exclusivity . Adopt pessimistic lock mode , You can prevent other transactions from operating on the data at the database level , prevent read - Write and Write - Write The conflict of .
边栏推荐
- MySQL数据库常用命令
- What scenarios have rust, which is becoming more and more mature, applied?
- Interviewer: talk about log The difference between fatal and panic
- Keil5 “Loading PDSC Debug Description Failed for STMicroelectronics STM32Hxxxxxxx”解决办法
- Highlights
- Installation and operation instructions of SVN client (TortoiseSVN)
- C语言 libcurl交叉编译
- 2022/7/23
- Idea essential plug-ins
- go channel简单笔记
猜你喜欢
P2P 之 UDP穿透NAT的原理与实现

Memory and packet buffer management of LwIP

Idea essential plug-ins

专访即构科技李凯:音视频的有趣、行业前沿一直吸引着我

Dating activity records

Food safety | eight questions and eight answers take you to know crayfish again! This is the right way to eat!

Tme2022 campus recruitment background development / operation development / business operation and maintenance / application development written examination (I) a little self analysis of programming q

Drawing PDF form (II) drawing excel form style in PDF through iText, setting Chinese font, watermark, logo, header and page number

SLA 、SLO & SLI

图的相关操作
随机推荐
如何选择数字孪生可视化平台
How to choose digital twin visualization platform
Li Kai: the interesting and cutting-edge audio and video industry has always attracted me
Drawing PDF form (II) drawing excel form style in PDF through iText, setting Chinese font, watermark, logo, header and page number
面试官:说说 log.Fatal 和 panic 的区别
Unity 贝塞尔曲线的创建
Talking about Devops monitoring, how does the team choose monitoring tools?
Basic operation of bidirectional linked list
Automated test Po design model
Go defer and recover simple notes
Mock service Moco series (III) - redirection, regular expression, delay, template, event, sub module design
关于云XR介绍,以及5G时代云化XR的发展机遇
Polynomial addition
SLA 、SLO & SLI
The new version of 3dcat v2.1.3 has been released. You can't miss these three function updates!
2022/7/23
Oracle导入出错:IMP-00038: 无法转换为环境字符集句柄
Joseph Ring problem
mongodb 集群及分片
Ch582 ble 5.0 uses Le coded broadcast and connection