iCloud Drive is files. Most apps need records: a note, a workout, a player's save with fields, indexes, and sharing. CloudKit is Apple's answer for third-party and first-party apps: containers with public, private, and shared databases, CKRecord graphs, subscriptions for push-driven change notifications, and a server that owns conflict resolution rules you can influence with change tags. The client SDK talks in operations (fetch, modify, query) so a developer is not merging JSON blobs over a generic object store. For Apple, it is also how Notes, Photos metadata, and a long list of system features sync without each team running a custom backend.

Records, zones, and the change token

A CloudKit private database is per iCloud account. Custom zones let you group records that should sync atomically-ish (a zone is the unit of some sync operations). Clients keep a server change token and ask "what happened since." That is the same incremental-sync idea as other mobile stores, with Apple's push service (APNs) waking the app so you do not poll. Tokens that are too old expire; the client must refetch, which is a burst you need to handle on a fresh install or after a long offline period.

CKRecord.changeTag is optimistic concurrency: you send the tag you last saw; if the server has a newer write, you get a conflict. Apps that last-write-wins without merging fields will drop data when two devices edit offline. CloudKit will not invent your merge. It will tell you both versions existed. First-party apps invest in field-level merge; many third-party apps do not, and users notice.

Sharing, quotas, and the server you do not operate

Shared databases and CKShare let a user grant access to a record subgraph. That is a permissions product: revocation, participant lists, and the difference between public database (app-wide, carefully used) and private. Abuse of the public database is why Apple rate-limits and why "just put it in public" is not a backend strategy.

Quotas and privacy are the operational frame. Developers do not get a dump of all users' private data — by design. Debugging sync therefore depends on device logs, CloudKit Dashboard for development containers, and user-initiated reports. Production incidents are often schema changes (adding a field is easy; changing a type or index is not) and notification storms. Subscriptions that fire too broadly wake millions of devices.

The mid-size steal if you are not on Apple's stack: structured records with incremental tokens, push invalidation, and explicit conflict tags beat "the whole JSON document is the file." If you are on Apple's stack: treat CloudKit as a database with offline merge, not as a fire-and-forget disk in the sky.

Assets (CKAsset) are a separate failure domain: a record can sync while the blob is still uploading, or a fetch can succeed with a missing file on a flaky network. Apps should show "placeholder until asset ready" rather than a broken image that users try to fix by editing the record again. Retry asset downloads independently of record change tokens so a large video does not block the rest of a zone.

What you can borrow

  • Sync with incremental change tokens and push, not full-document polling.
  • Store field-level merge rules; last-write-wins on a whole record drops offline edits.
  • Scope sharing as a first-class permission graph, not a public bucket of records.
  • Plan for token reset and first-sync bursts; they look like DDoS on your own backend.
  • Version schema conservatively. Mobile clients lag app-store updates by months.