Welcome to “SnipNotes in detail” – a new series of blog posts where I want to give you a detailed look at some of SnipNotes’ more subtle features and how they work behind the scenes. Today’s post is all about iCloud synchronization. How does it work? Is your data safe? Read on to find out.
Nowadays many people use more than one device. I personally own an iPhone and two iPads, which I all use on a regular basis. Consequently an important aspect of nearly any app is to provide some cloud connectivity, so that users can synchronize data between their devices. On the other hand the stored data must be protected from unauthorized access, which basically limits the possible storage locations to well known storage providers like iCloud or Dropbox – No user wants to store data on some developer’s private server after all.
SnipNotes uses iCloud as a storage provider. More specifically, it uses CloudKit, an interface that enables developers to store app data on Apple’s iCloud servers. CloudKit saves all data into the user’s personal iCloud account, so it cannot be accessed by the developer or other users. It also creates a separate container for every app that uses the service. This way the data can only be accessed by the associated app. The following diagram illustrates this concept:
When you open SnipNotes for the first time, it checks for an active iCloud account and downloads any existing snippets. Every time you save a new one, the data is stored locally and put onto a queue. Afterwards SnipNotes tries to synchronize itself with iCloud and upload your new snippet. This process can fail of course, e.g. if you have no cellular reception or the iCloud servers are unavailable. In this case the data stays on the queue and will be processed the next time your app communicates with iCloud. This happens on three occasions:
- Every time you open the app or the widget
- When you pull down the snippet list to refresh
- When you create a new snippet in the app or in the widget
The queue mechanismen ensures that the app’s local and iCloud data are always synchronized and no snippet is left behind! There is also a queue for deleted snippets, which works the same way.
Of course this is just the beginning. SnipNotes’ cloud features will be greatly enhanced in the coming months, when more features and platforms are added. Stay tuned and thanks for reading!