Which will be the best way to update users ReadOnly database using Core Data (iOS) -


i'm building ios app based on our goverment's open data,

i use coredata store data, there 8 entities in xcdatamodel,

some entity cotains 20000+ row of data's, , database read-only,

i won't , user won't modify database, such delete/update/create, read-only database.

the open data goverment keep update, isn't scheduled (and not often), , need let user update database if open data updated.

i considering 1 best way update users database?

1) fetch json server, delete contents database, , insert again.

disadvantages: a) risk high, user/system may terminate app while updating. b) lots of cost of network traffic

2) clear database, fetch entities data server on ios simulator, insert data,

after that, copy database documents folder, put on server, let user download whole sqlite database, , cover old database.

i think second 1 better, don't know take risk? or there disadvantages of method?

thank you!

if database heavy , , read-only, suggest upgrade database , launch new version of application, when user updates app appstore, previous db woud deleted , new 1 installed, rather not take risk of doing background data fetch as, may lead network lost/ app termination errors, , updation stuck in middle, better safe , relase new version updated db


Comments

Popular posts from this blog

java - Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved -

Round ImageView Android -

How can I utilize Yahoo Weather API in android -