Monday, April 23, 2012

iPhone app - Use pre populated database or rely on a web service?

I'm working on an iPhone app that allows the user to browse a product catalogue. Potentially, this catalogue could hold 1000+ items. Every product is related to a Brand, and have some attributes such as color, size etc.



I'm think of pre-populating a SQLlite DB and including it in my app's bundle, then, like in CoreDataBooks example, on the first launch I'll use the NSPersistentStoreCoordinatorto check if the database has been created, and if not copy the default database to the desired location and move on.



But the product catalogue needs to be updated, and since the database will hold other information that the user added - like add a product to favorite etc., I don't want to overwrite the database once it has been initialized (from the default).



So I was thinking about using the network, calling a webservice, but wouldn't that be way to heavy on the network? It should be fast to browse products, and I fear that relying on webservices will slow down things unacceptably?





No comments:

Post a Comment