News for hackers. Stuff that matters.
Re:New MongoDB alerts and advisories page by tedsuo on Monday November 14, 2011 @03:10PM (#3235479)
I read recently that mongo has a global lock on write. That was news to me, does anyone have more info?
Re:New MongoDB alerts and advisories page by ehwizard on Monday November 14, 2011 @03:15PM (#3235506)
Currently, there is a global read/write lock. MongoDB does extensive yielding and tracking of on vs. off disk to mitigate the effects of this. In subsequent versions (2.2) , we'll be lowering the scope of this lock as well.
Re:New MongoDB alerts and advisories page by jcapote on Monday November 14, 2011 @04:06PM (#3235692)
So only one read at a time?
Re:New MongoDB alerts and advisories page by cheald on Monday November 14, 2011 @04:10PM (#3235706)
You can read concurrently, but the write lock will block read locks.

http://www.mongodb.org/display/DOCS/How+does+concurrency+wor...

Re:New MongoDB alerts and advisories page by e1ven on Monday November 14, 2011 @05:22PM (#3235968)
If you have a lot of writes, this is a KILLER. You need to be very careful here.

Note, even with Read-Slaves, you are STILL blocked, since each write replicates to each Read-Slave, and counts as a blocking-write on that slave while it replicates in.

We dramatically increased application performance when we refactored to remove a lot of little writes for things like caching, and moved them to memcache.

Re:New MongoDB alerts and advisories page by tedsuo on Monday November 14, 2011 @06:53PM (#3236241)
Does this make mongo a bad choice for storing real time statistics?
Re:New MongoDB alerts and advisories page by moe on Monday November 14, 2011 @07:24PM (#3236334)
You always have to benchmark for your own use-case.

This is even more true for mongo than for other databases because mongo doesn't degrade very well; when you overload it with writes it will effectively grind to a halt.

This is documented e.g. in the clustrix benchmark: http://sergei.clustrix.com/2011/01/mongodb-vs-clustrix-compa...

Re:New MongoDB alerts and advisories page by stonemetal on Monday November 14, 2011 @04:14PM (#3235724)
No, a read write lock is a lock designed so that multiple readers can hold the lock, but only a single writer can hold the lock. That way readers know no write is taking place(as many reads as you like can take place), and writers know they have exclusive access.
Re:New MongoDB alerts and advisories page by e1ven on Monday November 14, 2011 @05:23PM (#3235970)
Yes, but keep in mind that while the write lock is in place, reads are blocked, not just writes.