Adding a Database Connection?


#1

Hail, Ionites!

I am tasked with creating a soultion for managing asset information for my organization, and I need to have it functional by the end of the week. That said, I am grateful for any and all help or advice leading to a workable solution for my problem space.

My current issue is adding database functionality to my app, which is intended to scan barcodes on asset tags and, presumably, pull up or even update information about that asset using some kind of database system.

I have begun implementing this system with SQLite and the related Ionic Native plugins, but have never really nailed down whether that is the correct solution to my problem.

My concerns are:

  • Will using SQLite be a poor solution for the sake of database integrity when two users are scanning and editing concurrently?
  • Is there a simple way to integrate database functionality without using SQLite, such as linking the app to a central database server with MySQL?

The cost-benefit ratio between these two options, using SQLite to get a quick fix and using a possibly more secure solution with MySQL, is still unclear to me, as I am hazy on which would take more effort and research to get working by Friday.

The database would be required to store and manage data about IT assets, including computer specs, (RAM, MAC address, service codes, et cetera) as well as contextual data, (ie, department and location). If this explanation helps us all find a solution together, then all the better!


#2

When you say “even update”, I take that to imply that the only viable solution is a backend database. Without one, the only updating that can take place is locally on each device, which doesn’t seem very useful.


#3

Thank you for the confirmation. I will look into ways of connecting my app to a back-end database. Do you have any suggestions on where to start my search? I’m not sure how to begin, but my guess would be to create a database using MySQL, and then link it somehow with URI/URL’s to my app’s buttons and logic. That way the persistence is on the server, and the app is merely a “remote-control” and mobile access to the data.


#4

It really depends on what language you prefer for your application server. I like Go, for many reasons. It has concurrency built in as a first-order language feature, making multithreaded programming a real breeze. It does not require massive harness overhead like Java-based application servers do. I use gocraft/web for HTTP routing and middleware, and sqlx for interacting with the database. I prefer PostgreSQL to MySQL, but Go’s database library works equally well with either.


#5

Thank you very much for your help! I will look at those options and make a decision.

Thanks again!


#6

Honestly, if you only have a week, you should probably retain a service, and then pitch your organization to give you some time to do an in-house solution, which will be cheaper in the long run. MongoDB and Firebase play well with Ionic. (I’m relying on hearsay about MongoDB. I’ve used Firebase myself, and it works pretty well.) MongoDB is cheaper, but has less powerful features. And if your organization is small-ish, you might be able to use either service for free.