Which database should be used to store data?


#1

Hi there,

I am completely new to IONIC framework. Going to work on a new mobile application based on this framework.
Here are my questions if someone can help, please.

  1. Which database should be used to store data locally on the Mobile device? Our user needs to go to remote locations where internet connection is not available.

  2. Will there be any limit that we can store in the local DB or it depends on mobile device memory capacity?

  3. Can these data be encrypted on the given DB?

  4. Later when user connects to internet then these locally stored data will be transferred across to our main oracle database system.

Looking forward to getting answers.

Thanks - Hitesh


#2

You have several choice for your db.
Pouchdb (object oriented database like couchdb)
The main advantage of this one is that you can synchronise it with a remote DB. It uses websql

Ionic storage. As well an object oriented database. It works with a simple key value. It uses sql mobile to store object so I think it stringify your object and parse it when you get it back.

Personnally even if Pouchdb propose more functionnality I prefer ionic storage. Really easier to configure. And if you don’t do a direct symchronization from server (for example if you have pre and post treatment I don’t see the need)

Concerning the volume of data it depends of the storage type (cache, memory etc). I know that there are some issues storing object with local storage expose them to garbage collector of the os. But if you store it with sql (most of the time stored in a file) you cam store as many data as you want.

Finally concerning the data encryption. You can put in place a password and use a cryptography algorithm to store it.
You can use crypto js wich propose lot of algorithms.