Post

Replies

Boosts

Views

Activity

In-app storage/sync strategy for shared objects
I'm new to iOS development and am trying to formulate a strategy/design for the data layer of my application. I have objects (basically lists, so they're objects that contain N sub-objects) that can be shared among users. The users need to be able to make changes to these lists and the changes should be synced to a cloud data store. They will be stored/represented as JSON documents (think MongoDB). One list may have at most a hundred-ish items on it, but will more often have on the order of a few tens of items. The app needs to work offline, and when a connection is restored, sync the changes that have accumulated since the connection was interrupted. For my backend, I desire to use something like FireBase or AppWrite to enable easy future cross-platform compatibility (in other words, I don't want to use CloudKit because I think it will not be as straightforward to leverage on other platforms), and to give me a base for user registration/account management among other things. One user may at most have a handful (less than a dozen) lists, most of the time. So, all that said...I'm trying to figure out the right "local" storage strategy for these objects in iOS/Swift. It's unlikely that the total data would ever amount to more than a few hundred KB, so maybe files (one JSON file per list)? In addition to the structured data, there will be metadata/ancillary data that needs to be cached/stored with the lists (like images pulled from the web based on a URL on a list item). Core Data? I'm not going to be dealing with huge datasets, nor is there any relationship between the lists -- just between the lists and users, and of course the items in a list. So I'm not sure if Core Data is worth it. I'm just completely new to iOS development and am struggling to determine the right approach here, so any advice would be appreciated.
3
0
918
Jan ’23