Client-side data storage - IndexedDB for global data using? - database

I was wondering, if data stored in IndexedDB can be used globally by other users? Or it's purpose is only for local usage? For example if I'll do web page with personal notes, can the notes be visible for other users on other computer (if I want them to be?). And how the IndexedDB works. If it's localy stored, then what if the user will uninstall the web browser or just even destroy the computer. Will the data be deleted?
Sorry, if it's silly question for You :D

IndexedDb is browser based storage mechanism. A few reading in the web will give enough information I will try to list of few crux of indexedDB
It is browser based Data storage mechanism , its scope limited to browser and machine. That means one you stored something to IndexedDB only from that browser and that machine and from same domain only you can access. Domain means if you have a website which useses indexedDb from no other website can be accessed.
Indexed db can use 6-10% of the hard disk of your machine
Indexed db data wont be loosed if you closed or rebooted your machine. even Ctrl+f5 wont loose the data. if user do a hard cache delete then the indexed db data will be loosed.
Check CanIUse for the browser compatibility
IndexedDB basically work of Key value pair data storage, we can do indexing on those itesm, in indexed db we can created multiple store to categorize the data, store concept wise we can relate to table in SQL
IndexedDB is a way for you to persistently store data inside a user's browser. Because it lets you create web applications with rich query abilities regardless of network availability, these applications can work both online and offline. IndexedDB is useful for applications that store a large amount of data
IndexedDB is an asynchronous API that can be used in most contexts, including Web Workers. It used to include a synchronous version also, for use in web workers, but this was removed from the spec due to lack of interest by the web community.
more about indexedDB please read here.

Related

Expo data encryption and large storage abilities

We are researching at using Expo to build an offline first app that requires medium storage and encryption.
It is an app comprising of several user filled forms and data tables.
The core requirements are:
Offline ability. Allowing the user to fill in several forms whilst offline and have the device push this data via POST requests when the device receives a connection.

So far we have a basic working offline app that utilises redux offline (https://github.com/redux-offline/redux-offline) to store client actions when the device is offline and automatically sync this when the device receives a connection.
Store a medium amount of JSON data (100MB+) for offline usage. The app needs to grab this data from a GET request and store it locally. The JSON data is used as part of the form journeys, allowing the user to select from predefined dropdown fields, etc. 

We are unsure how to approach this with Expo.
All the stored data must be encrypted. 

We are unsure how to approach this with Expo.
Authentication via Keycloak. 

This is proving difficult due to the lack of documentation on Expo. It seems it should be done via AuthSession (https://docs.expo.dev/versions/latest/sdk/auth-session/).

The storage and encryption requirements are proving particularly difficult to work around. Are these possible with Expo? Or would we need to eject for React Native for these? Any advice would be much appreciated. Thanks




Google Memcache vs Local disk cache?

I want to build a mobile app. Should i cache data on google cloud memcache or it's better to store data into the mobile phone local memory ?
which is faster ? and what type of data should be put in cache in the case of a mobile app ?
Thanks you.
Any data that you want to make available to your user in offline mode (device not connected to the Internet) should be cached on the device itself. You may also want to cache the data in online mode as well (e.g. an Email App may cache the emails for last 7 days) and updates the cache when the user refreshes or the server pushes new emails.
MemCache on Google Cloud is something you would use in your Application Server for caching data that does not change very often so you don't have to keep loading the same data from the database for every request, thus improving the performance.
It is always faster to access the data on the local device compared to accessing the data from Cloud.

What database to use with PhoneGap

I am creating my first mobile app using Phonegap and I am not sure what database to use with it. I have read a few articles and am finding it hard to decide on which is best to use. Two of the ones mentioned most seem to be MongoDB or SQLite
Because PhoneGap needs Nodejs, I thought that MongoDB would be a good option but is that too robust? I am familar with Mongo but don't want to choose it just because it is convenient, I would prefer to use what is best.
The app will hopefully store information both locally and on the server. Will probably be information like you would store for a messaging app - user info, contacts, messages etc.
Anyone know which would be best to use? - or if another would suit my needs more?
The phonegap is a framework that allows you to create mobile applications using API's multi-platform web. The choice of the database in my view
should not be given by the framework, but for what kind of application you are doing.
I see three ways to store data from your mobile application.
1: Local Storage (http://www.w3schools.com/html/html5_webstorage.asp)
2: SQLite (https://github.com/brodysoft/Cordova-SQLitePlugin)
3: Database on server (can be anyone.)
The choice will depend on what you want from your application. If it is a simple application that will be stored few data, use the local storage of html5 that stores documents. If your application is already a bit bigger and more complex, you can use SQLite implemented in the browser using HTML5 which is supported by most current mobiles browser. The advantage here is that access to the base is done without the need to build a server. In the third case your application would be the type client server, in which case you should use the database on the server. The choice of database can be what you feel is appropriate.
I suggest you go with IndexedDB if you want to store a lot of data in the client or LocalStorage which is able to store 5MB worth JSON data.
This is just the front end but for the back-end there are so many to choose from and if you plan to write the back-end with Node then it will be wise to use MongoDB.
I would suggest using the Cordova-SQLitePlugin as it offers a native interface to sqlite, avoiding quota restrictions associated with WebSQL on mobile devices. The plugin is supported on Android, iOS and Windows Phone 8 platforms.
If you want to keep a local and remote database in sync, you may consider using this in conjunction with PouchDB
PhoneGap can use LocalStorage, SessionStorage, or SQLite databases. You can also use PhoneGap to connect to the devices native classes via a plugin, and pass the native class data, that it will then store on the device. check this link to find more details
What database does PhoneGap use and what is the size limit?

Setup for server side for application which need easy acces to data source

I need to make a couple of mobile applications which will all access a shared online resource using e.g. REST API.
What is the cheapest/easiest setup for the server side resource?
The server should store data as either xml/json/sqlite and expose an API to access this data, preferably in a secure manner.
Is Google App Engine appropriate? Any others?
What would be a recommended way to implement?
What I want to do is to have a database online (not important which format - content will not bee too big, ~5000 records with around 5-10 text fields each), have a simple management console for editing this content and then let mobile devices connect in order to check if they have the latest data and update if required.
The data should not be publicly available but key may be hardcoded into device applications.

What Is the Size Limitation of Google Chrome Databases for Google Chrome Apps?

I'm mostly a PHP developer. Now I have a client steering me in the direction of a standalone app that runs on Mac, Windows, and Linux. It deals with pilot weather data and he wants it to work offline during flights and then sync up fresh data in the airport wifi. Immediately I thought of Google Chrome Apps for this.
I need to know what the storage size limitation is for Google Chrome databases when used specifically in Google Chrome Apps. I've been having trouble finding this information.
Some extra, related questions are:
When someone clears their Chrome browser cache, does this mean their Databases, Local Storage, and Application Cache are wiped clean? Or, is it only some of those resources are cleaned? My fear is that someone clears their cache and there goes all my offline app storage in the Google Chrome App.
I hate to sound dumb, but is "WebSQL" different than Chrome Databases?
Why would I use Local Storage versus a Chrome Database? (See the difference when you do CTRL+SHIFT+I in Chrome, and then click Resources tab.)
Storage limit is 5MB by default. This limit can be disabled with unlimitedStorage permission (more details here).
I don't want to clear my cache to test it, but I am pretty sure storage is not cleaned. There is a related issue report which says that there is no way to delete storage explicitly right now.
WebDatabase, WebSQL, "a database api" all refer to the same thing - web database API that is currently based on SQLite.
Web database is pretty much a full scale database, localStorage is just a hashmap (an associative array) that stores key-value pairs.

Resources