简体   繁体   English

从同一数据库中的不同mongodb上限集合中同时读取和写入

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

I have a database with multiple small-sized capped collections (about 1MByte each) that I am using in tailable cursor mode. 我有一个数据库,其中包含多个我在可跟踪光标模式下使用的小尺寸带帽集合(每个约1MByte)。 Is it possible to read and write simultaneosuly from different mongodb capped collections in this database (ie tail (and read) from collection B while writing to collection A). 是否可以同时从此数据库中不同的 mongodb封顶的集合进行读写(即在写入集合A时从集合B的尾部(和读取))。 I read that mongodB locks the database on a write. 我读到mongodB会在写入时锁定数据库。 Is this true? 这是真的?

In MongoDb 2.6, locking is done on collection level. 在MongoDb 2.6中,锁定是在集合级别完成的。 and in MongoDb 3.0, document level locking is done. 在MongoDb 3.0中,完成了文档级锁定。

so it is possible to read from one collection and write to and other collection using cursor from MongoDb 2.6 onwards. 因此可以使用MongoDb 2.6及更高版本中的游标从一个集合中读取和写入其他集合。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM