Read and Write Simultaneosuly from Different mongodb capped collections in same database

108 Views Asked by At

I have a database with multiple small-sized capped collections (about 1MByte each) that I am using in tailable cursor mode. Is it possible to read and write simultaneosuly from different mongodb capped collections in this database (i.e. tail (and read) from collection B while writing to collection A). I read that mongodB locks the database on a write. Is this true?

1

There are 1 best solutions below

0
On BEST ANSWER

In MongoDb 2.6, locking is done on collection level. and in MongoDb 3.0, document level locking is done.

so it is possible to read from one collection and write to and other collection using cursor from MongoDb 2.6 onwards.

http://www.infoq.com/news/2014/04/MongoDB-2.6-Kelly-Stirman