Webvanta Blog: Creating Effective Websites

Using a Single Database for a Mobile App and a Website

Using a Single Database for a Mobile App and a Website Image

Often, a mobile app uses data that is also displayed on a website. For ease of administration, it’s best to have all the information stored in one place and automatically made available wherever it is needed.

If a mobile app must be online to view the content, you can use HTML from the website to deliver the content through the app as well. But if you want to store the data on the phone, or do anything with the data other than displaying it, using a format called JSON (JavaScript Object Notation) is often the best approach. It provides a compact representation that is easily read by the app.

It’s best if the app can store all its data on the phone or tablet, so it doesn’t require Internet connectivity. At the same time, you’d like the data to be updated whenever new data is available, and you don’t want users to have to update the app just to get new data.

You can get the best of both worlds using the following approach:

  • Include a ‘starter’ set of data as part of the app
  • Provide an ‘update’ file from the server that includes any changes that occurred since the last build of the app
  • When the app is launched (or wakes), if it has Internet connectivity at the time, fetch the update file and store it on the device

Tour the Finger Lakes Site and App

We’ve used this approach for an app called Tour the Finger Lakes, which provides curated tours of the Finger Lakes region of New York, based on the user’s starting point, interests, and desired trip length.

All the content is stored in a database on a Webvanta site, and a subset of the information is available as part of the Tour the Finger Lakes site.

When the user installs the app (for iPhone or iPad) from the AppStore, it includes all the data that was current as of when that version of the app was created.

Each time the app starts, it checks for updates and merges them in with the stored data. The app can run without an Internet connection, using the data it has already stored.

The staff at the company that provides the app, Culinart Media, can update the information at any time by logging in to the website’s control panel. Updates are immediately reflected on the website, and are also added to each user’s installed copy of the app the next time the app is launched (if the phone or tablet has an Internet connection at the time).

We’ve found this to be a flexible and powerful approach that gives app users the best of both worlds: access without requiring a net connection, and content that is updated when new information is available.

Topics: Mobile Web

Add Your Comments

(not published)

Reader Comments


So, what database application did you use?