Before talking about how to use iCloud, it helps to understand what it is. Let’s start with a description from Apple’s iCloud web site:
“iCloud stores your music, photos, documents, and more and wirelessly pushes them to all your devices. Automatic, effortless, and seamless — it just works.”
To make it simpler: iCloud is synchronization. It syncs your data between your iPhone and the cloud. It syncs your data between your iPhone and your Mac (there is also some limited support for Windows). It is incorporated into iOS and OS X Lion in such a way that, when combined with other enhancements (such as document versioning) you can get access to the latest, most up-to-date version of your data. The image below illustrates this flow.
Note that in the above description I emphasized the word “your”. As it is currently implemented, it is only data that you create or consume on your devices. Data access and storage is based on your Apple ID. There is no mechanism for associating multiple Apple ID’s with your data.
Before iCloud, applications normally accessed data objects (files/documents/databases) that were stored locally on the device. Sharing data between devices was typically done through an explicit user action, such as copy the file to and from a file server or web site.
What iCloud does is provide a series of interfaces that developers can use to integrate synchronizing this data with Apple’s iCloud servers. The synchronization is a part of the operating system (OS) that developers can access using these application programming interfaces (API’s). Some of the features of these interfaces include:
- File upload/download;
- Data streaming (for database objects);
- Conflict resolution (there are changes in both the document on the server and the document locally that need to be reconciled).
Apple has done a really good job at integrating iCloud in such a way as to minimize the amount of change you need to make to your code, but there are some challenges that developers need to keep in mind. For example, opening a document that is stored locally on the file system is fairly simple – you can easily search the file system for the file, and opening it is so fast that you can typically wait for the file to open. With iCloud, you now have to deal with network latency issues. Opening a file now might entail downloading the document from the iCloud servers. You now are at the mercy of the speed of the network and the size of the document.
iCloud versus Dropbox
A lot of developers are incorporating services like Dropbox into their applications to enable synchronization and sharing of information (there are other services, such as Box.net, that some use as well, but Dropbox seems to be the most popular as of this writing, so that is where I will focus).
Dropbox provides file-level syncing between devices and the Dropbox cloud. Applications can take advantage of the API that Dropbox provides for uploading/downloading files. There is no intelligent cache management – it just downloads the files to the device and stores it if there is enough room. On some systems Dropbox also hooks into the operating system to provide an intelligent folder that mirrors the layout of data in the Dropbox cloud.
Another advantage of Dropbox – it supports multiple operating systems (OS X, iOS, Windows, Linux) and provides API’s for several different languages (Objective-C, Ruby, Python). There are also some third-party API’s that provide support for C#/.Net and Node.js (among others).
Finally, Dropbox supports sharing files and folders between users. This is done using the Dropbox login ID. There are no limits to the number of users with whom you can share data.
The cost of Dropbox is that you need to learn another API, and the amount of storage that you get for free is 2 GB. iCloud gives you 5 GB of storage, over and above any purchases you make in iTunes (any music/apps/books that you buy via iTunes do not count against your 5 GB storage limit). Both services allow you to purchase additional storage for a fee.
Any data shared between Dropbox users counts against the quota of each Dropbox users. For example, if user A shares a folder with users B and C, and C puts 2 GB of data in that folder, then both A and B are at their 2 GB limit, even if they haven’t put a single byte of data into their Dropbox storage.
Which to use? It all depends. If you have an existing appellation that stores data in local storage and want to take advantage of cloud backup and synchronization, then iCloud is the simplest way to get this. If you need to share data with multiple users, then you should use Dropbox (or one of its competitors).
Next: Enabling an XCode application to use iCloud