Cross-Store weak relationship with Fetched Properties?

后端 未结 2 1244
醉梦人生
醉梦人生 2020-12-30 17:51

I would like to separate my reference data from my user data in my Core Data model to simplify future updates of my app (and because, I plan to store the database on the clo

2条回答
  •  灰色年华
    2020-12-30 18:22

    I would go with just one store.

    For storing stuff in the cloud, you will anyway have to serialize the data, either as JSON or SQL statements, or whatever scheme you prefer.

    You will need a local copy of the data on the user's device, so he can access it quickly and offline. The cloud store can have only the user entity, while the local store (part of the app) can also have the reference entity.

    I have a similar project with a huge reference store (20000 records) with geographic information, and user generated content ("posts"). I use a single store. When I ship the app, the "posts" entity is also defined but empty. When I update the data model I simply re-generate the whole reference store before shipping.

    I see absolutely no reason to go for a cross store solution here.

提交回复
热议问题