Storing Data with the Data Store API

Problem

I need a place to store some data for my app, and I don’t want to use my own database or a third-party service. Is there somewhere I can stick it inside of Facebook?

Solution

Facebook recently introduced the Data Store API, which was still in beta as this book went to press. The approach is to provide specialized storage, highly targeted and optimized to the kind of data that app developers need to store, rather than taking the more generalized approach of Amazon SimpleDB. The API is grouped into the areas:

Specialized tables

One of the advantages of using the Data Store API is specialized tables, designed and optimized to store the kinds of data for which your app is most likely to need storage. The initial pass only includes a User Preference table, but Facebook is looking for feedback from app developers about the types of tables they might be interested in.

Distributed tables

Most web developers understand databases well enough to administer a single server but lack the experience necessary to design and maintain a complicated, scalable, distributed system. Using the Data Store API gives you access to a well-managed distributed system for free, designed to allow your tables to grow to millions of records without a significant performance loss.

Associations

If you’ve read Chapter 8 and checked out some of the performance recommendations around indexing or already have a good level of database design knowledge, you’ll be familiar with how indexing ...

Get Facebook Cookbook 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.