Hi all,
We are having trouble with mongodb while iterating over many collections and updating each record in the collections.
Our system compose of several collections about same document object model. We have something around 400 collections and each collection have around 100000 documents (which may increase to millions of records too).
So basically we iterate over each document in each collection and we update each document after making a fast computation with the document itself. The problem is that while we are doing this batch work, there are other processes who are inserting documents or updating existing documents to these collections. So when we run the batch operation, mongos performance decreases so much, and we are getting late answers to our queries.
I would like to learn what is the recommended solution for such an architecture? We are iterating each documents with a single thread right now, iterating over collections in parallel would increase the performance; but the main thing we don't understand is, why mongo's response time to queries increases dramatically when we iterate over collections, why iterating over collection A, decreases the performance of asking queries to collection B? Btw we work with morphia implementation of java driver.
Suggestions and feedback will be highly appreciated.
Cheers.