benjamin.ludwig
benjamin.ludwig

Reputation: 1585

iOS: using iCloud document storage for a small XML based database

Just wanted to know if this is a good idea:

I want to use iCloud to sync data between different devices in my iOS app. It's just a list of small objects without connections. But storing this list in the key/value store won't work because it's space is restricted to 1 MB or so and the list might get bigger (not much, but could...). Core data seems like an overkill to me and there is also the problem of possible duplicates.

So I wonder if it makes sense to subclass UIDocument to handle the XML file. Every object has an ID, so merging different versions of the file should be no problem.

Upvotes: 3

Views: 377

Answers (1)

Robotic Cat
Robotic Cat

Reputation: 5891

The choice of XML depends on the format of the data store (monolithic or transactions) and the volume of updates. If the entire file (1 MB+) is constantly being written to by your app (and hence sync'ed to iCloud) or if a small change causes the entire store to be sync'ed to iCloud then I would use Core Data. The advantage of core data is that only the transaction logs you require (or have changed) are synced.

Upvotes: 1

Related Questions