Dustin
Dustin

Reputation: 455

Phone App: Cloud Storage vs Local

I've been developing a few applications using JavaScript utilizing Adobe PhoneGap for cross platform integration. However, I'm currently stuck at an architectural decision regarding application storage and looking for guidance.

The one app that I currently have stores user data (e.g., user configuration options, table records, etc.) as a text file in Google Drive. Here is the workflow for app startup:

  1. App loads
  2. User logs in w/ Google Account
  3. System checks if app data exists on Google Drive
  4. If data exists, load file. Else create data file.
  5. Parse data file.
  6. Populate datatable(s), charts, etc.

And when the user saves, I would essentially bundle this data up and save the text file back to Google Drive.

Now, I know that the bottle neck would of course be parsing this file and it's not as great as reading data from a database, but that would be my question: How would you go about storing data in the cloud in a cost effective manner? Would you just backup data periodically as a text file? Is there a free (i.e., w/ limitations) storage option that you would recommend?

I have experience writing full-stack JavaScript applications, but have never deployed these anywhere...more of a learning experience.

I was thinking that maybe the best option would be to deploy a node server and mongoDb to some cloud service (possibly AWS?) but our goal is to, at the end of the day, to make some cash. Let me know if you need more details!

Upvotes: 2

Views: 623

Answers (1)

Zezura
Zezura

Reputation: 126

its of course dependent on how many users you have and what you want to accomplish, because sending data over the internet and saving it on a server gives other angles you have to think about, just as you mentioned costs is one of it. and it isn't profitable to run a dedicated server if you haven't enough users. you can use the users own Google drive storage, some people like it others don't. more important is security because some user data is very sensitive and transmitting it over internet is a concern where you have to take the right measures to make sure it is safe. also performance wise. I know applications when you open them, first thing you have to do is wait because it has to load and synch from internet, its frustrating.

and what if the user device is offline ..?

I dont know what kind of application it is so i cant give you a recommendation.

if it is sensitive, you probably dont want to send it over the internet. is it large, dont send it often, and have a cache on the device. if it isnt an internet only (constant connection) application, make sure it is possible working offline. sending files/data all the time is a bad idea because it kills the battery and it makes the user mad (internet consumption costs).

when thinking about security, performance, battery & costs, local is always better.

and syncing once or twice a session isn't bad, for backup reasons, try to do this in the background (asynch) so that it doesn't block your user. make sure that you have a cache on your device (if it is possible).

my applications checks for online data once at the beginning. but my application uses settings so that I can change without having to push an update again. but it has a cached (offline) version for when the device is offline.

for example when you have an banking app, it isn't possible to have a cached version because the cache could contain old information and give the user wrong information. so the user has to wait for downloaded information. but it can still be asynch because the app should still be responsive (ui). so it can display an animation loading icon or the user can browse and wait for the data being downloaded.

I hope this anwers your question.

Upvotes: 3

Related Questions