Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Here is the current state of functionality for Map/Reduce in MongoDB</p> <p>1) Most of the performance limitations for Map/Reduce still remain in MongoDB version 2.2. The Map/Reduce engine still requires that every record get converted from BSON to JSON, the actual calculations are performed using the embedded JavaScript engine (which is slow), and there still is a single global JavaScript lock, which only allows a single JavaScript thread to run at a single time.</p> <p>There have been some incremental improvements to Map/Reduce for sharded clusters. Most notably, the final Reduce operation is now distributed across multiple shards, and the output is also sharded in parallel.</p> <p>I would not recommend Map/Reduce for real-time aggregation in MongoDB version 2.2</p> <p>2) Starting with MongoDB 2.2, there is now a new Aggregation Framework. This is a new implementation of aggregation operations, written in C++, and tightly integrated into the MongoDB framework.</p> <p>Most Map/Reduce jobs can be rewritten to use the Aggregation Framework. They usually run faster (20x speed improvement vs. Map/Reduce is common in version 2.2), they make full use of the existing query engine, and you can run multiple Aggregation commands in parallel.</p> <p>If you have real-time aggregation requirements, the first place to start is with the Aggregation Framework. For more information about the aggregation framework, take a look at these links:</p> <ul> <li><a href="http://www.10gen.com/presentations/mongonyc-2012/new-aggregation-framework" rel="noreferrer">http://www.10gen.com/presentations/mongonyc-2012/new-aggregation-framework</a></li> <li><a href="http://docs.mongodb.org/manual/reference/aggregation/" rel="noreferrer">http://docs.mongodb.org/manual/reference/aggregation/</a></li> </ul> <p>3) There have been significant improvements in Map/Reduce in MongoDB version 2.4. The SpiderMonkey JavaScript engine has been replaced by the V8 JavaScript engine, and there is no longer a global JavaScript lock, which means that multiple Map/Reduce threads can run concurrently.</p> <p>The Map/Reduce engine is still considerably slower than the aggregation framework, for two main reasons:</p> <ul> <li><p>The JavaScript engine is interpreted, while the Aggregation Framework runs compiled C++ code</p></li> <li><p>The JavaScript engine still requires that every document being examined get converted from BSON to JSON; if you're saving the output in a collection, the result set must then be converted from JSON back to BSON</p></li> </ul> <p>There are no significant changes in Map/Reduce between 2.4 and 2.6.</p> <p>I still do not recommend using the Map/Reduce for real-time aggregation in MongoDB version 2.4 or 2.6.</p> <p>4) If you really need Map/Reduce, you can also look at the Hadoop Adaptor. There's more information here:</p> <ul> <li><a href="http://www.10gen.com/presentations/webinar/mongodb-hadoop-taming-elephant-room" rel="noreferrer">http://www.10gen.com/presentations/webinar/mongodb-hadoop-taming-elephant-room</a></li> <li><a href="http://api.mongodb.org/hadoop/MongoDB%2BHadoop+Connector.html" rel="noreferrer">http://api.mongodb.org/hadoop/MongoDB%2BHadoop+Connector.html</a></li> <li><a href="http://www.mongodb.org/display/DOCS/Hadoop+Quick+Start" rel="noreferrer">http://www.mongodb.org/display/DOCS/Hadoop+Quick+Start</a></li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload