What database is preferable for iOS app development and how to implement search? What database is preferable for iOS app development and how to implement search? database database

What database is preferable for iOS app development and how to implement search?


The best choice depends on the amount and complexity of the data. If you only have a few hundred animals with a few attributes per animal then putting all of the data in a plist and loading all of the data into memory is fine.

If you have more data with large notes and other attributes, then you may not be able to load all of the data into memory. Then using SQLite would be a better option.

Core data is another option but it has the biggest learning curve and may be overkill for such simple data. Core data would be a good choice is the data was not read-only, if you had more relationships, and you wanted to sync the user data across devices.


It is good that you are reading all those things. I will try to create a "dumbed down" answer for you.

You ask about a database. This means for you where do I store the data. Apple and most technical people talk about this with the words Persistence or where do I persist the data.

The three commonly used (but I am sure not exclusive) methods of storage is:

(1) in a text file known as a plist file
(2) in a text file in xml format and
(3) in a sqlite file or database file

How do I access this data?

You are then going to hear about CoreData, CoreData was introduced by Apple to make it easier to access your stored data and also to help the small devices deal with large amounts of data. Accesing a Sqlite database without coredata needs a bit of work, but because of CoreData they make this easier.

As for the xml and plist, these can be accessed by simply reading the file into an Array or Dictionary and then you either search for or show data from those objects as you normally do.

(one thing about the sqlite/core data idea is that when setting up CoreData you can set up a sqlite data base or it can be in xml format.)

Once you know these two things, then you can mix and match based on what is needed for your purpose. If you have a large amount of data and do a lot with it then a sqilte file with CoreData access is going to be a good choice. If it is a very small amount of information then you can use a simple plist file and use a Array or Dictionary object to get the information, use it and then store it again in the file.

In your case it does sound like a simple plist would work.


Core Data is often sited as the preferred iOS database technology and if you want to gain some familiar with databases in iOS, you should probably just start there. Use your favorite search engine and look for "Core Data Tutorial". Ray Wenderlich often does a good job in his tutorials, and you should definitely check out the Apple links (the videos and various "getting started" documents found at http://developer.apple.com). Go through a tutorial or two before you consider posting follow-up questions on Stack Overflow.