Beruflich Dokumente
Kultur Dokumente
Foursquare Overview
A location based social network. Allows users to "check in" at bars, restaurants, shopping destinations, etc to share their location with friends. Rewards users with virtual prizes (points, badges) that can sometimes lead to real life rewards (5 checkins at a restaurant might get you a free appetizer) ~1.3M registered users. ~615k checkins/day. Nearly 50M checkins total. Very rapid growth.
Transition to Mongo
Currently writing checkins, tips, venues (and various things related to venues) to MongoDB. All writes still go to PostgreSQL as well. Slowly migrating various reads. Exclusively use mongo for our "Who's here" server. A short lived record of where our users are at any given time (contains 3 hours worth of data). Migrating geo related queries first. Other items later. Checkins a high priority (due to the fact that they represent the bulk of our data).
Geospatial Indexes
MongoDB conveniently supports geospatial indexes out of the box. Currently limited to Earth like dimensions (+/- 180 degrees in each of 2 axes). It cheats to make the math easier/faster by assuming a flat earth where 1 degree of latitude or longitude is always the same distance. This is fine as long as you are dealing with relatively small distances (as foursquare does) Implemented using geographic hash codes atop standard MongoDB b-trees
Foursquare uses this to find nearby venues, tips, specials, and various other geolocated data.