Day 2: Indexing, Aggregating, 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.

Indexing: When Fast Isn’t Fast Enough

One of Mongo’s useful built-in features is indexing in the name of enhanced query performance—something, as you’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 as well as 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 a series of ...

Get Seven Databases in Seven Weeks, 2nd Edition 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.