The latest version of MongoDB has introduced support for geospatial indexing. Joroen’s (@jvwilge) post is a quick guide to geospatial indexing in MongoDB based on a classical problem:
I recently finished my bachelor thesis about collecting gps points and discovering running routes from those points. The main bottleneck in my application was counting the number of points within a certain radius of a point. You basically have to check all the points to see whether they’re inside the radius. Let’s say you have 10^6 points (and I have), then (10^6)*(10^6) steps are needed.
I advised to use a geospatial index with PostGIS in my conclusion, but that’s not really new and cool, so let’s give it a shot with MongoDB.