Using the Cloud, iCloud for Apple users, is not exactly new. “The Cloud” has been around for many many years now. As a developer you decide how you use the cloud in function of the application you are building.
A social media app will most likely be completely cloud based. A large database app with your personal information will not be cloud based and maybe not even have any data in the cloud, except for backups or something…
Apple provides possible scenario’s to handle all these situations.
* Core Data for your local database storage.
* Core Data for iCloud to sync the database over your devices.
* iCloud Drive and Files in iOS 11 to storage files in the Cloud.
* Cloud Kit, as a file transfer system between your iCloud storage and a device.
You can also use none Apple solutions because of specific features, or because you need a cross-platform solution.
Unfortunately the provided solutions are almost always just a 80-90 percent fit. The reality is that you want local storage to work fast and offline, but you still want all the data in the Cloud, and available on all your devices, the moment you switch to the device.
This means in Apple lingo that you want Core Data and Cloud Kit to work hand in hand and be synchronized automagically. But Core Data doesn’t map on Cloud Kit. These are two separated worlds. But the developer can of course make it map and match for his application.
This is how this works.
* The only through is the cloud.
* Everybody gets the latest updates from the cloud.
* Everybody updates to the cloud.
* All the data that is relevant is in the cloud.
* All relevant data is transferred to a local storage e.g. Core data.
* On your device you always work in the local storage, which than sends the updates to the cloud in the background.
This means of course that there is a lot of error handling to be done to make this work correctly. I guess that’s our job.
So this week I’ll be working on an iOS, macOS, web integration with Core Data and Cloud Kit. I’ll we focusing on our DoDone app, because the database schema is not too complex. There will be a lot of error handling 😉
I suppose this will be the default implementation methodology for the next years.