I'm building an iPhone application with a database (most likely I'll use Core Data for the first time, but it can still turn out that I'll be using SQLite depending on your answers here).
The content of this database should be updated on a regular base from some online storage (most likely a MySQL database).
As the initial database will be rather large it will be in the app so the user won't need to download that, the updates will be rather small so those can be downloaded. You can see that 'Delta' updates are a must (downloading the whole dataset each time is just too much data). Updates will consist of a few new records and eventually some corrections of existing records
The local database will have a few tables/entities (with a lot of relations between them) that need to be updated, those tables/entities will be read-only (*). There will be another few tables/entities where the user can enter comments (read/write) but they never have to get updated, this is private user data. As a matter of fact I'll sometimes create an extra table with just a 1-1 relation to keeps nicely separated (dataset tables/entities versus comments tables/entities).
Can somebody provide me with a way to generate a file online with all the changes in the db, that can be downloaded to the phone and efficiently and correctly parsed so that those changes/new records are applied. I've been thinking like something similar to the migrations Rails uses to maintain its database, but can't seem to find anything that looks clean and performant. Keeping in mind dat relations between different tables/entities is very important, that's were my inspiration is failing...
(*) for a start read only, later on the user will be able to add records and edit them. He will never be able to edit the existing records, and his own records don't need to go back to the server.
In a broad, architectural sense, here is what I would suggest:
I can't recommend RestKit highly enough. Stick out a few hours of fighting the learning curve and you'll never look back.
As an alternative i would suggest AFNetworking+MagicalRecord because you mention Rails in your question. (Restkit was for me too complicated)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.