Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CloudKit - no server-side logic?

Tags:

With CloudKit, you can focus on your client-side app development and let iCloud eliminate the need to write server-side application logic. CloudKit provides you with Authentication, private and public database, structured and asset storage services — all for free with very high limits.

You cannot upload any code to run on Apple's servers?

I've heard it being compared to Google App Engine and other cloud computing platforms, but without the ability to run your own code, isn't the whole thing pretty limited and not really comparable?

For example, if I want to build a news app which periodically pushes stories on topics that the user is interested, then this can't be done just using CloudKit because I would need scheduled jobs and data processing on the server.

Any thoughts?

like image 876
alan0xd7 Avatar asked Jun 05 '14 20:06

alan0xd7


People also ask

Is CloudKit a server?

CloudKit Now Supports Server-to-Server Web Service Requests In addition to providing a web interface for users to access the same data as your app, you can now easily read and write to the CloudKit public database from a server-side process or script with a server-to-server key.

Does Apple use CloudKit?

Overview. The CloudKit Database app is a web-based tool for developers to manage their iCloud containers. You can sign in to the CloudKit Database app through the Apple Developer web portal or through the CloudKit Console at https://icloud.developer.apple.com/.

Is CloudKit a backend?

CloudKit it's Apple's Backend as a Service platform and it's specially designed for iOS apps. CloudKit was introduced in the year 2014 as an amazing solution to integrate iCloud in your applications with ease. This cloud solution has been introduced by Apple.

What is CloudKit on Mac?

Overview. The CloudKit framework provides interfaces for moving data between your app and your iCloud containers. You use CloudKit to store your app's existing data in the cloud so that the user can access it on multiple devices. You can also store data in a public area where all users can access it.


2 Answers

Server-side

As you said CloudKit doesn't allow server-side code.

But there are possibilities.

Crons

You don't want to connect to the iCloud Dashboard everyday in order to perform the push by adding a record. One solution here is to code an app on a mac server (I guess mac mini as server will become more popular with CloudKit) that add a new Daily CKRecord every day.

Subscriptions

Subscriptions concept is that the client registers for specific updates. You can create a record type called Daily for instance and make users register to it. You should check the Apple documentation and WWDC14 videos (even if Subscriptions are not detailed, it's a good start point).

The good thing is push notifications are linked with the subscription concept. So basically you say: Send my a notification for each new CKRecord of type Daily added.

BaaS party

What is the point for using CloudKit (vs Parse and other?)

  • Price: CloudKit has a really nice pricing
  • Ready to go: 2 clicks inside XCode and you are ready to go
  • User consistency: you get free user login for all his devices through their iCloud account. With a very good privacy system. And you can get relationships with a smart system.

But:

  • You are stick on Apple platform. We don't even know if we could export the data..
  • Only data-centered for now (no server-side code)
  • The CloudKit dashboard is too limited

The future

CloudKit is still pretty new. At the WWDC some guys behind it made me understand that they are still heavily working on it. My bets are they are working on 2 important points :

  • Server side code execution through remote scheduled tasks
  • CloudKit for Analytics (Visualization side)

Edit: Apple guys are fully aware and concerned about the lack of web access for the data. It means that one day it may be accessible from other platforms. I read in a comment that Apple probably would have bought Parse if CloudKit wasn't better, AFAIK they tried to buy Parse (skills buy it's said, but we don't really know).

Update WWDC15

CloudKit is now available in JS and some dashboard are available now. Wait and see.

Update February 2016

CloudKit Now Supports Server-to-Server Web Service Requests

Web Services Reference

like image 58
Francescu Avatar answered Sep 28 '22 07:09

Francescu


In some cases, we do not need server-side logic, and just storing static data can cover all the usage scenario.

In this case, it would be very helpful if there's a free accessible storage that you can store something. CloudKit provides such stuffs rather then full service platform.

Yes it is limited. Anyway can be useful for some people. For example, your case actually can be supported CloudKit. Though CloudKit is just a static storage, it support subscription. Which monitors a set of conditions and pushes the event notification to client. It's fortunate that the only background job feature supported by CloudKit is just what you need.

Anyway, if you need more, then you might need to consider full fledged servers. Usually simple web services with simple server-side code execution support are also limited.

like image 21
eonil Avatar answered Sep 28 '22 06:09

eonil