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?
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).
There are four different levels of locking in MongoDB.
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.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With