Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it true that MongoDB has one global read/write lock? [closed]

I am reading this article - http://wiki.postgresql.org/images/7/7f/Adam-lowry-postgresopen2011.pdf and I noticed that an ugly part of mongoDB is the global lock.
Is it true that MongoDB has a global lock for read/write operations? what about the latest versions? Is there a plan to change that?

like image 610
tom Avatar asked Sep 21 '11 20:09

tom


People also ask

Does MongoDB have locks?

What type of locking does MongoDB use? MongoDB uses multi-granularity locking [1] that allows operations to lock at the global, database or collection level, and allows for individual storage engines to implement their own concurrency control below the collection level (e.g., at the document-level in WiredTiger).

How many locking mode are supported in MongoDB?

There are four different levels of locking in MongoDB.

Which operation in MongoDB lock more than 1 database?

The following MongoDB operations lock multiple databases: db. copyDatabase() must lock the entire mongod instance at once. Journaling, which is an internal operation, locks all databases for short intervals.

Does MongoDB lock document for update?

In MongoDB we recommend using the findAndModify command for this scenario. This command is atomic and thus lock the document for a status change. Each service instance should do: db.


1 Answers

yes. it's true: http://www.mongodb.org/display/DOCS/How+does+concurrency+work

but they are working on it, if you look at the change log of the 2.0, they started to deal with it: http://blog.mongodb.org/post/10126837729/mongodb-2-0-released

The read/write lock is currently global, but collection-level locking is coming soon

like image 131
ALoR Avatar answered Sep 23 '22 14:09

ALoR