osiris1@yahoo.com
Posts: 0
Joined: Mon Jun 10, 2013 5:34 pm

Using LocalStorage vs db for user settings

I developing an app and not sure if I want to use the database function to store data on the cloud. I want my data to be stored locally on the device (IOS) and don't need the overhead of going back to the server to get it.

So I'm using the "localStorage" method.

Is this advisable? Should I be using something else? I need to the data to be persistent since I'm saving user settings that the app depends on.

Any advise would be appreciated.

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Using LocalStorage vs db for user settings

Saving user settings in local storage as fine as long as you don't store any sensitive data. Also keep in mind that the data can be deleted by the user -- so you need to add the logic to reset the settings.

osiris1@yahoo.com
Posts: 0
Joined: Mon Jun 10, 2013 5:34 pm

Using LocalStorage vs db for user settings

ok. Thanks for the info. No sensative data will be saved. But is the LocalStorage method reliable? When the app closes, it will be available again when the app runs and the user does not clear it?

Is there a local db option and is that recommended?

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Using LocalStorage vs db for user settings

Yes, the data will stay if you close the browser.

Local storage is a standard browser API, you can more about it here: https://developer.mozilla.org/en-US/d...

You can use in browser database as well.. but the API is a little bit more complicated.

osiris1@yahoo.com
Posts: 0
Joined: Mon Jun 10, 2013 5:34 pm

Using LocalStorage vs db for user settings

browser database meaning websql?

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Using LocalStorage vs db for user settings

Yes, or IndexedDB

Return to “Issues”