Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 346
benjamin.ludwig Avatar asked Jul 02 '26 14:07

benjamin.ludwig


1 Answers

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.

like image 112
Robotic Cat Avatar answered Jul 04 '26 05:07

Robotic Cat



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!