3

I am developing iPhone app for a web application currently running online. Current web application uses txt files to keep data. Current system uses its own standard to keep data in files and also made custom algorithm to read and write data in it. Each txt file is below 1 mb size. There are lot of data manipulations going on.

So while implementing the same what I want to choose for iPhone app? In apple website they said that 'SQLite is perfect for low-level relational database work' https://developer.apple.com/technologies/ios/data-management.html But in my case it is high level.

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

Edit 09/02/2013


Thanks for ur answer 'user76859403'. Current web application is using database too for saving vital information like member details, login credentials etc. and other stuffs are saved in files. In current system there are different sections and all those sections have several sub sections and related information. Such sections and their details are saved in files. Custom algorithm created just read those files and put all data in cache as records (same as in core data managedobjectcontext) and whenever there is a change in data the whole file is overwritten. I would also like to know whether it is possible to import those classes and algorithms that is using in webserver to iOS, so I can save time rewriting the same algorithm for iOS? Current server codes are in C#

2 Answers2

3

First, I must say that I find it odd that the web-server is storing its data in text files and having customized algorithms to manipulate the data. Giving that lots of data manipulation are occurring, this seems highly inefficient to me; a database would be better in my opinion.

From your side however, it all depends on the data you're processing from the server. You can use the following:

  1. SqlLite or CoreData - Using these approaches is one route to go. But you may have the extra work of sorting out the data into tables etc.. usual database stuff. Refer to the answer on this link to get a better idea on the difference between the SqlLite and CoreData or Google a bit.

  2. Just save the data in files just like its being done on the server. There are several ways to do this including Property List files etc. Here's one method where it's being done using NSCoding.

I would say that the approach#1 approach has the advantage in organization and speed (has the advantage any relational database would have). However, the disadvantage is you will take more time properly setting up this correctly.

Approach#2 might save you time as you would not have to consider structure of data or anything, just dump and save. However, ask yourself, is the size of server data liable to increase? is speed a factor in processing? etc etc.. Think about long term, not just the short fix. This approach is right for you if the data will be relative the same and load is small.

The approach you choose largely depends on your data load and furture project scope (be it quick fix, or longer term improvement of current system) in my opinion.

Community
  • 1
  • 1
Just a coder
  • 15,480
  • 16
  • 85
  • 138
0

I'd highly recommend using Core Data if you are dealing with anything "high level". Also checkout mogenerator https://github.com/rentzsch/mogenerator. This great tutorial should help you get started: http://www.raywenderlich.com/934/core-data-on-ios-5-tutorial-getting-started

  • Johannes
Johannes Fahrenkrug
  • 42,912
  • 19
  • 126
  • 165