CloudKit vs Realm
CloudKit
developer.apple.comRealm
realm.github.ioSide by side
| Figure | CloudKit | Realm |
|---|---|---|
| Price from | Free | Free |
| Free plan | Yes | Yes |
| Free trial | — | — |
| Open source | — | — |
| Web | Yes | — |
| Windows | — | Yes |
| macOS | Yes | Yes |
| Linux | — | Yes |
| iOS | Yes | Yes |
| Android | — | Yes |
| API | Yes | — |
| Self-hosted | — | Yes |
| Plans published | 1 | 1 |
| Spec score · Mobile Databases | 8.2 (#6) | 7.7 (#18) |
| Data model | CloudKit organizes app data into containers with public, private, and shared databases. | Realm exposes data as objects that can be queried in code without an ORM. |
| Integrations | CloudKit automation supports integration tests from Xcode or a CI system, and CKTool JS can be embedded in developer tools. | Realm's former Device Sync connected data across users, devices, and a backend in real time. |
| Security | Developers can configure fields in private CloudKit databases to be encrypted in storage and in transit to their application. | Realm Swift says data can be encrypted in flight and at rest. |
Plans
In their own words
CloudKit
CloudKit is Apple’s service for storing structured app and user data in iCloud and synchronizing it across devices and the web. Data is organized in containers with public, private, and shared databases, and synchronization is bidirectional across iOS, iPadOS, macOS, tvOS, watchOS, visionOS, and web apps. CloudKit supports Swift, Objective-C, and JavaScript. Apple Developer Program membership includes up to 1PB of free storage for each app. CloudKit Console lets developers manage containers and schemas, inspect test data, and review telemetry, logs, and alerts. Fields in private databases can be configured for encryption in storage and while travelling to the application. Public databases use World, Authenticated, and Creator roles. Separate sandbox and production environments are provided; production schemas can only be changed in a forward-compatible manner. Automation supports integration tests from Xcode or a CI system, and CKTool JS can be embedded in developer tools. CloudKit JS adds CloudKit support to web apps. A free plan is listed at free, while pricing is from $99/yr. Incoming traffic is throttled by limits and controls that may change over time.
Realm
Realm is an object database for local data persistence in mobile and edge applications. It runs directly on phones, tablets, and wearables, and presents data as objects that developers can query in code without an ORM. The database supports relationships, generics, and vectorization. Its documentation describes apps continuing to work through weak signal, offline periods, or outages. Listed SDKs include Java, Swift, Objective-C, JavaScript, and .NET; the JavaScript implementation supports React Native on iOS and Android, as well as Node.js and Electron on Windows, macOS, and Linux. Realm Swift supports encryption in transit and at rest. Realm Studio can open and edit local and synced Realms and administer Realm Object Server instances. Former Device Sync connected data across users, devices, and a backend in real time, but MongoDB announced deprecation of Device Sync and Realm SDKs in September 2024. Realm is free and open source under Apache License 2.0.