This application is data heavy with not many tables but a lot of entries. The application it self would only need to read the data and not write or update the data in anyway. With these thoughts in mind I went and did some research on data storage for android and phone gap applications.
I have a number of different options here when it comes to data storage. I can use a DBMS to store all my data or I can use androids internal storage feature, another option to save my data locally with XML or JSON.
Internal Storage features
Android has an internal storage feature. From what I have gathered this feature is good for saving users app settings or preferences. It doesn’t have any built in features for structuring and organizing data.
XML / JSON
XML / JSON is faster to retrieved and write data with and is very good for transferring data over the internet. But due to the amount of data my app is storing I feel like these technologies won’t aid the app with feature updates and growth of the application.
DBMS stands for database manage system. Android has inbuilt support for Sqlite which is a small database system which is built for performance over size and security. The good thing about having a database is that my content would be neatly organised into tables. I would also be able to create the relation ships between the parent categories , sub categories , and Links with foreign keys. A Database like Sqlite would allow the application’s data to expand more easily with feature updates.
I think that the database approach would be the best solution for information management in my application.
I used Visio to to design my database. The name row will be used to identify each table. each category has an image associated with it. each category , subcategory and link will have and optional context text. The context text is used to add a bit of context to the category for if the name is to broad.
I had two options when it came to image storage. Option one Store the image it self in the database. This option is good if I was to have the database running off a web server with the app connecting to it to retrieve data from, this option also has greater security.
Option two to save the location of the image in the app folder structure. This way is much faster but offers less security.
Seeing that the application isn’t storing any sensitive data or images I went with the URL approach.
Database diagram :
2 thoughts on “Data!”
You could store the images in blob storage on AWS and have the link in the DB. This means your images can be retrieved from anywhere.
This is a good idea. If tweeks to the images are needed I don’t need to release a new update for the app I can do it live. AWS has CDN as well right? So images will load nice and fast.