Building a recommendation engine, foursquare style
Wednesday, March 23, 2011 at 9:00AM |
Derek Stainer FourSquare has a new post on their developer blog where they describe how they built their recommendation engine for the latest FourSquare 3.0 release. Why do we care? Because FourSquare is a known MongoDB user and of course Mongo is part of their engine. How do they use MongoDB?
Querying an initial corpus to rank – We retrieve a set of venues within the radius you specify as candidate recommendations. For performance reasons, we pull back a fixed number of entries (pro tip: this means that the smaller the radius you set, the more venues we look at per unit area, potentially giving you better results). Given these constraints, we need to have a way of querying our venue database for the top N values sorted by some criteria within a specific geocircle. Most databases simply cannot handle this (at our scale), as it first requires the ability to index geographically and then further requires a way to compound the geo index. Even scanning each record within the circle is prohibitively expensive. There aren’t many databases in the world that can do this, but after some tuning and custom logic, MongoDB is able to do it in less than 30ms for a 10mi radius in New York City
Check out the full post at: Building a recommendation engine, foursquare style
10gen,
FourSquare,
MongoDB 

Reader Comments