Question

which tool is best for Database Management in iPhone Development

  1. Core Data
  2. SQlite
  3. NSDocuments directory

I want to store 3 or 4 object details ex. User, user's messages etc..

Was it helpful?

Solution 2

Regarding your question

1.if you are really faimalary with core data that is how to handle it in multithreaded environment and the memory management specially for one to many and many to many relationship then core data is really advantageous. Storing and retrieving can be done easily.

2.Sqlite is advantageous in a situation where you have multiple table and you want to retrieve some data from db by joining then in that case you can write some simple query and you can retrieve the data easily.

3.Document directory you can use it if you have very large amount of data that 40-50mb then you can directly store that data in to some file in the document directory. Sine storing this much big amount of data in db will cause memory problem.

As you are planning to store 3-4 entry then you can use sqlite or core data any of them. If data size is too huge then directly store it in to document directory in some file.

OTHER TIPS

As you want to store 3-4 objects details ***SQLite*** will be a good option.

1. Core data: Best suited for Object relational Mapping
2. SQlite: Best for basic database operations

You should use SQLite

Here is the reason from SQLite site.

SQLite is an embedded SQL database engine. Unlike most other SQL databases, SQLite does not have a separate server process. SQLite reads and writes directly to ordinary disk files. A complete SQL database with multiple tables, indices, triggers, and views, is contained in a single disk file. The database file format is cross-platform - you can freely copy a database between 32-bit and 64-bit systems or between big-endian and little-endian architectures. These features make SQLite a popular choice as an Application File Format. Think of SQLite not as a replacement for Oracle but as a replacement for fopen()

So SQLite is better option then file management in NSDocuments directory.

Now for the option of Core Data - SQlite is easy to maintain then Core Data.

You can get more information about SQLite From Here

You could implement your database in sqlite and use the sqlite3 library in ios for the database operations and manage the database in firefox sqlite manager, but this is old fashion stuff (you will think you are still developing in the 90s), or you could implement your database in core data, and the framework will take care of generating classes that represents your database's tables and relations, and use core data's classes to sort and query your tables' models, and you can manage your database in core data editor, which is a paid (but worth it program).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top