MongoDB Case Study: foursquare

Foursquare is a location-based social network which has grown rapidly since its inception in 2009, requiring efficient ways to scale with limited engineering resources. As its user profile and activity stream data increased, foursquare made the strategic decision to migrate storage of venues and check-ins to MongoDB as a long-term scalable solution to the company's continued expansion.

Originally, the foursquare application relied on a single relational database. As the company experienced rapid growth, they split the data to two nodes: one for check-ins (the biggest data set) and one for everything else. However, it was clear that in time, check-ins alone would increase beyond what a single machine could handle. MongoDB not only solved the initial problem, but also provided the tools for agile development.

Foursquare can now take advantage of MongoDB's built-in auto-sharding. MongoDB’s auto-sharding partitions the database, allowing foursquare to scale writes and spin up new nodes as their application grows. Instead of writing its own sharding layer, foursquare can rely on MongoDB’s automated scaling infrastructure, enabling engineers to focus on building their application.

MongoDB has allowed foursquare it to dramatically simplify its data model. For instance, rather than storing tags (“has wifi”, “great for dates”, “hotspot”, etc) in a separate table, in MongoDB tags are embedded directly into the document representing a venue. This is both more efficient at run-time and easier for engineers to understand and manipulate.

As Harry Heymann, Lead Server Engineer at foursquare, explained, ...MongoDB is a practical database for practical problems that engineers in the real world have…it's only going to continue to evolve into a database that just makes our jobs easier as application developers, which is fantastic.” To learn more, visit the case study or hear directly from Heymann about how MongoDB has made a difference at foursquare.

Tagged with: mongodb, foursquare, agile development, big data, nosql, 10gen