Reputation: 551
As I understand, both aggregation framework and MapReduce have the same goal, but my question is, when should I use MapReduce and when aggregation framework?
Upvotes: 1
Views: 141
Reputation: 43884
Map reduce is really good for long standing aggregation tasks which might take anywhere between 10 minutes - 10 hours (or more) to complete.
Imagine the aggregation framework as being similar in kind to SQLs own with the operators like GROUP
.
It is really designed for quick inline querying to return a result back however, map reduce is for much larger jobs and is not designed for inline usage.
Upvotes: 3
Reputation: 675
Refer: http://docs.mongodb.org/manual/core/aggregation/
My understanding is that when you are dealing with large quantities of data, MapReduce will perform much better as compared to Aggregation framework.
Upvotes: 1
Reputation: 2382
aggregation framework has limitations over sharded collections, where you will have to use MapReduce.
Upvotes: 1