Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between CloudKit and Key-Value Storage

What is the difference between iCloud's "Key-value storage" and CloudKit?

An example scenario would be: if one were to sync a sizable array containing dictionaries, arrays, and other objects. Would the developer want to use CloudKit or Key-value storage?

like image 426
Jake Chasan Avatar asked Sep 13 '15 18:09

Jake Chasan


Video Answer


2 Answers

CloudKit is for syncing real data records as well as assets (files).

iCloud's key-value storage is essential NSUserDefaults but synced across devices.

So think of it that way. If it's a simple value you might store in NSUserDefaults, use key-value storage. If it's actual data you might store in a plist, database, file, or core-data, use CloudKit.

like image 151
rmaddy Avatar answered Sep 22 '22 14:09

rmaddy


I just thought it might be helpful to mention that according to the iCloud Design Guide:

Apps may store only 1 MB of data in their key-value storage

So that may be something that one would want to take into account in deciding between CloudKit and iCloud Key-Value Storage.

In my case, for the app I'm currently working on this limitation is totally fine. However, I would imagine that in a larger project the 1 MB limit might not be sufficient. Helps to know that up front when making the decision!

Hope this helps!

like image 25
Evan K. Stone Avatar answered Sep 22 '22 14:09

Evan K. Stone