How efficient is it to search through arrays of data in NoSQL
I'm currently in the process of migrating a CRM over to Mongo. Our leads table has a schema that varies a lot so it makes sense to put it in a NoSQL database. However, there are some parts that I'm a bit worried about from an efficiency standpoint in Mongo.
I have a database of 5 million leads that I'm setting up as a collection in Mongo. The problem is, each of these leads has events associated with both it and a sales person. I'm wondering how efficient it would be to store the events in the database and index them on uid.
So basically, I might have 50 million events (average of 10 events for each of the 5 million leads). Now I want to see what events salesman 32 has assigned to him, so I would search for all of the events with his UID in the leads collection.
Is thi开发者_JAVA技巧s a practical thing to do in Mongo or is this going to be incredibly inefficient?
tl;dr Simplified question: How fast is Mongo at indexing arrays of objects? Is it efficient if I have 50 million posts in a database that contain 10 comments each with the author field of each comment indexed and want to find all comments by an author?
i believe this is what you're looking for: http://www.mongodb.org/display/DOCS/Indexes#Indexes-EmbeddedKeys
精彩评论