Day 2: Indexing, Grouping, Mapreduce

Increasing MongoDB’s query performance is the first item on today’s docket, followed by some more powerful and complex grouped queries. Finally, we’ll round out the day with some data analysis using mapreduce, similar to what we did with Riak.

Indexing: When Fast Isn’t Fast Enough

One of Mongo’s useful built-in features is indexing to increase query performance—something, as we’ve seen, that’s not available on all NoSQL databases. MongoDB provides several of the best data structures for indexing, such as the classic B-tree, and other additions such as two-dimensional and spherical GeoSpatial indexes.

For now we’re going to do a little experiment to see the power of MongoDB’s B-tree index by populating ...

Get Seven Databases in Seven Weeks now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.