Best approach to store data


#1

Hi,

I’m new to Ionic (and JS) and I’m developing an app that read data from bluetooth devices. I have an history page where I need to show the history data of each device selected from a list. The data that I need to store/show are:

An uint8array buffer with 225 elements (the main history data)
one pointer (number)
one date (string) dd/mm/yy hh:mm:ss

My idea is to use Ionic Storage, taking the bluetooth address like key, but I’m not sure how to store all data to value. I was reading that I can save a JSON object but I’m not sure if I can use it in my case. My first idea is store all data like concatenated strings but maybe exists a better solution (and transparent) to save all the data without converting anything.

My questions are:
What is the best approach to achieve this?
Is better SQLite than Storage for my case?.

Any guidance or help?

Thank you.


#2

The best/ professional approach is used SQLite rather than Storage. Storage is used for short time storage data i.e you can store data as a session data.


#3

Ionic Storage defaults to SQLite.