Topic: Database when using an API

I am trying to use Foursquare to find nearby restaurants. Should I create a database and store the results? or should I be making calls in my model and skipping the storage into my database.

Eventually, I want users to be able to add restaurants to the database if it is not yet on Foursquare, or missing information...if this changes anything.


Re: Database when using an API

First I would look at the IV. Retention section of their Foursquare API Platform Policy.

After reading that I would probably use some sort of background worker queue to grab the data from their API and store it in your own datastore. Then your application can use the data that you have stored in your datastore and not worry about making calls to their API all of the time with each request to your app.