Are you using files or sqlite database using core data in my iOS project?

I am developing an iPhone app for a web app that is currently running on the internet. Currently the web application uses txt files to store data. The current system uses its own standard for storing data in files and also configures a custom algorithm for reading and writing data. Each txt file is less than 1MB in size. There are many data manipulations.

So, implementing the same thing, what do I want to opt for an iPhone app? On Apple's website, they said "SQLite is ideal for low-level relational databases" https://developer.apple.com/technologies/ios/data-management.html But in my case, it's a high level.

So please help me make a decision. I want to manage data in files or sqlite database using core data? What are the points and ends of each? Is there a memory or performance issue when using files?

Edit 09/02/2013


Thanks for ur reply 'user76859403'. The current web application also uses a database to store important information like member information, login credentials, and so on, while other files are stored in files. There are different sections on the current system, and all of these sections have multiple subsections and related information. Such sections and their data are saved in files. The custom algorithm created just reads these files and puts all the data in the cache as records (same as in the core data managedobjectcontext), and whenever the data changes, the entire file is overwritten. I would also like to know if it is possible to import those classes and algorithms that are used in the web server for iOS, so I can save time by rewriting the same algorithm for iOS? The current server codes are in C #

+3


source to share


2 answers


First, I must say that it seems strange to me that the web server stores its data in text files and sets up algorithms to manipulate the data. While providing a lot of data manipulation, this seems very inefficient to me; the database would be better in my opinion.

From your side, everything depends on the data that you process from the server. You can use the following:

  • SqlLite or CoreData. Using these approaches is one way. But you may have some extra work to do with sorting data in tables, etc. Plain database. See the answer to this link for a better understanding of the difference between SqlLite and CoreData or Google.

  • Just save the data to files in the same way as it is done on the server. There are several ways to do this, including property list files , etc. Here's one method where this is done using NSCoding.



I would say the # 1 approach has advantages in organization and speed (has an advantage that any relational database can have). However, the disadvantage is that it will take you longer to get it set up correctly.

Approach # 2 can save you time as you don't have to look at the data structure or anything else, just dump and save. However, ask yourself how much the server data size can grow? is the processing speed? etc. etc. Think long term, not short fixes. This approach is suitable for you if the data is relatively similar and the load is small.

The choice you choose depends a lot on your data load and the expansion of the project scope (be it a quick fix or a longer term improvement to the current system) in my opinion.

+2


source


I would highly recommend using Core Data if you are dealing with anything "high-end". Also output mogenerator https://github.com/rentzsch/mogenerator . This great tutorial will get you started: http://www.raywenderlich.com/934/core-data-on-ios-5-tutorial-getting-started



  • Johannes
0


source







All Articles