Should I sync web service data?
Hi,
I'm building an iPhone app which displays food vouchers. The data is taken from a website via a .NET WCF service.
There are 3 main objects within the data model. 'Restaurant', 'Location' and 'Voucher'. A 'voucher' can have multiple locations and a location can have multiple vouchers. A 'location' can have only 1 'restaurant' but a 'restaurant' can have multiple 'location's.
I've started building the app search facility where you can search based on location etc. At the moment each search makes a call to the web service and returns the required data and stores it on the phone using Core Data.
When the user does another search, the stored data is cleared and re-added.
My concern is that when viewing the results, you are able to view the voucher, then view the restaurant that is assigned to that voucher. Then when viewing the restaurant, you can view the other vouchers that restaurant has. To do this, I would need to hit the service again to get the other vouchers.
I wonder whether I should be storing all of the data from the site using Core Data and then sync the data between the website and the app. This would mean that the search wouldn't need to call the web service.
I can see that this method would be better as not only would you not need to hit the service so often, the app would be less reliable on an internet connection.
However, my biggest problem with this is that when a user first downloads the app, they would need to get all the data that's stored in the website database. But if I have 2000+ vouchers, each with locations and restaurants, that would take quite a bit of time to download and store etc.
Is this the method I should be looking into, or is my current method workable?
|