Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Summary of locks generated by common MongoDB database operations

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

MongoDB uses read-write locks, which have high priority. When there are read-write requests at the same time, write locks are given priority. Prior to version 2.2, the lock level was global, and after version 2.2, it was database level. 3.0 Later, WiredTiger engine was introduced and document-level lock was added.

Operation lock category

query read lock

getMore reads locks from cursors

write data write lock

Delete data write lock

Update data write lock

map-reduce read-write lock

Create index write lock, default is to create index in foreground, will lock the whole db, it is recommended to put it in background

eval global lock, unless nolock:true is used

aggregate read lock

repairDatabase global lock

copyDatabase global lock

Synchronous write lock of replica set, mongodb writes data to master node, also writes to oplog, locks primary, for slave node, data is written in batch mode, and writes to different slave nodes are performed in parallel mode

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report