IOS Swift App - Database

I am learning Swift and am able to build a basic application. I have an app in mind as an end goal that will allow users to log in, answer questions (which are constantly added by me and record their results.

This will obviously require some form of database hosted and accessible on the Internet. My thoughts are that this will be done using something like MySQL Db (like the databases on the site), but is this the best and generally accepted way of doing things?

+3


source to share


2 answers


If you want to host it somewhere on the internet, I think the best solution would be to create a REST API (you can write this in any language, I will name a few: Rails, C #, Java, PHP, Python), I think which is generally bad practice to call the remote database directly in your swift application.

If you need a local database for your users, you can use SQLite, Core Data, Realm and other similar tools.



To cover everything, you could create some kind of database as a service and use that instead of the REST API. This will be Parse, Firebase, etc. These services are free to start with, but expensive as you expand your requirements.

+4


source


Apple provides Basic Data Structures for working with databases on iOS.



There are other options, but I prefer Realm . It's very easy to learn and use. Here is a tutorial for it.

+1


source







All Articles