tags:

views:

518

answers:

4

I would like to get feedback from all you seasoned developers as to what methodology would be the more "correct" or "efficient" way of implementing my solution.

I have a 4.5 MB flat file that is some 16,000 rows with 13 columns. I know I can import this into SQLite and create my data model but would it be more iPhone efficient to use this file locally on the iPhone or have the application read the data from a web service?

Thanks.

+1  A: 

a local database should always be more efficient in terms of user experience than a web service

ennuikiller
A: 

I guess it depends a bit on how much of the data you need at any one time. If your users need to download a lot of data just to use your application, that would make your app potentially very slow and also unusable without a network connection.

How often do you need to update the data? Frequent updates would favour a web service solution. Otherwise you'd need to update your app and resubmit every time a bit of your data changes.

Another thing to think about: how much do you pay for web traffic for your website? It could become quite expensive if a lot of users constantly need to download data. Unless you use some kind of subscription you only get money once, when you sell the app.

Personally, I'd probably lean towards putting the data on the phone and not using a web service.

Thomas Müller
+1  A: 

I'd use both.

A remote source allowing for a dynamic datastore, and a local datastore with local cacheing seems like a pretty safe bet.

As for the web service. Unless there is any server-side only business logic, maybe give a cloud solution a try. Something like Amazon's SimpleDB comes to mind.

It of course really depends on how static your data is. As everyone has mentioned already if you don't need many updates the most effective solution is a sole local datastore.

Cheers

Phillip Jacobs
I'd go with this one, remember not everyone in every country has uncapped data plans. This would allow for a once only download + updates. If only one I would choose the download the sql db file. 4mb is small on a few GB of space.
jim
+1  A: 

If you are not going to update the data (or only update it when you are updating the app) the local sqlitedb is going to simpler and more responsive. You would probably be even better off importing the data into CoreData, that way you won't need to directly manipulate sqlite or deal with things like synchronous read APIs.

If you want to be able to have the app download updated data the choice because a lot more difficult, depending on the quantity of data, the frequency of updates, how large the changes tend to be, etc.

Louis Gerbarg