18

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?

2
  • 1
    This is not a properly constructed question. You should be more specific, and maybe include the relevant portions of the link you included.
    – Perception
    Sep 21, 2011 at 20:29
  • 1
    I'm pretty sure it's a per-database lock. So if you are writing to multiple databases, as I am in one project, you can write concurrently to them all. Sep 21, 2011 at 21:56

1 Answer 1

13

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

6
  • 5
    Global lock is gone in Mongodb 2.2 blog.serverdensity.com/goodbye-global-lock-mongodb-2-0-vs-2-2 Aug 14, 2012 at 7:08
  • 3
    @Brian - But we still have DB level locking, which for many people is the same thing.
    – UpTheCreek
    Jul 9, 2013 at 11:46
  • in mongo 2.4 there implemented other ways to yield the DB level locking in some case and the direction (probably 2.6 or later) is to have collection level locking.
    – ALoR
    Jul 9, 2013 at 12:22
  • Coming soon eh? It has been over 2 years and the collection-level locking issue is Open, Unresolved, and unassigned...sigh. Dec 16, 2013 at 15:44
  • yeah, that's a shame, but at least we got db level locking...
    – ALoR
    Dec 16, 2013 at 20:24

Not the answer you're looking for? Browse other questions tagged or ask your own question.