At one point or another you will have an idea for application that will also need a backend. I have personally gone through multiple phases playing with Spring framework, Ruby on Rails and Laravel. These were only mainstream frameworks. But as I live and breathe iOS daily, none of these ever clicked with me. Same thing happened always - after playing with these a bit, other responsibilities come up and you forget server side development.
Now when Swift is taking over Apple world, Swift on server side seems really appealing. Using same technologies on frontend and backend side seems really appealing. You could potentially also share logic between these. Last year I was ready to start exploring server side Swift when WWDC2016 happened…
Somehow I previously had not thought about using iCloud. I’m assuming, that the main reason was, that previously there was no way to share user records. Everything was either public or user private. This all changed with iOS 10, that introduced sharing of private iCloud records. That was the final hurdle for me, to take a serious look.
There was additional use case, where I was thinking that custom backend was needed - when you wish to share same data between different kind of apps. Then I realized, that you can share iCloud containers between applications from same company 😍
Possible drawback of iCloud is, that you can’t execute server side logic. But depending on your needs there are alternatives. You could subscribe to data update on app side. Or user server-to-server API for periodic data updates/checks.
For server-to-server requests I created my own nifty library TakToCloud.
These are the cases where I’m currently using CloudKit.
In Gambrinus app I’m using app specific container to map blog posts to RateBeer scores. Rate beer information is contained in a shared container, that is also used in beers log prototype I’m working on.
RateBeer score updates are pushed to shared container from command line.
LaughigAdventure contains shared code to gather user feedback. This can be included in any app. Conversations and Messages will be created in public database. On client side only Conversations started by current user are shown.
I’m record expenses in private user database with option to share these with other users. iCloud is used just as data bucket. All logic for summaries is on app side.
As I’m currently concentrating only on Apple platforms, I don’t see any need to look beyond iCloud for server needs. It may require some compromises. You can’t use it for public API-s, but overall my current needs are covered.
Tags: ios, cloudkit, api, sync