TangoStar
TangoStar

Reputation: 551

MapReduce or aggregation framework?

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

Answers (3)

Sammaye
Sammaye

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

Anurag Kapur
Anurag Kapur

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

Alex
Alex

Reputation: 2382

aggregation framework has limitations over sharded collections, where you will have to use MapReduce.

Upvotes: 1

Related Questions