Ensembles 3
Local-first sync for Core Data and SwiftData.

This package distributes pre-built XCFrameworks (binary only). Source code is available separately with a premium license. CloudKit and local backends are free to use; other backends require a license key. See Licensing below.
Manual: The complete guide to Ensembles 3 is included in the Manual/ directory as PDF, EPUB, and Markdown.
Ensembles is the only local-first sync framework for Core Data and SwiftData. Unlike most sync frameworks, it requires no custom server — your data syncs as opaque files through storage your users already have: CloudKit, Google Drive, OneDrive, WebDAV, or any custom backend.
No server can read, interpret, or control your data. It stays in your users' own accounts, and with built-in AES-256-GCM encryption it can be fully end-to-end encrypted before it ever leaves the device.
Because your users already pay for their storage, there are no server costs for you — no infrastructure team, no cloud bills, no scaling headaches.
Ensembles 3 is a modern rewrite of the Ensembles Objective-C framework in pure Swift, with async/await concurrency and Swift Package Manager distribution. It is fully backward compatible with Ensembles 2 cloud data.
Why Ensembles?
- Truly local-first — not just offline-first. Cloud data is opaque files, not structured records a server can read. No vendor can inspect, lock, or hold your data hostage.
- No custom server, no cloud costs, no cloud team — unlike other sync frameworks, there's no server to deploy or pay for. Users sync through their own storage accounts, so there are no cloud bills for you.
- Any cloud backend — 10 built-in backends including CloudKit, Google Drive, OneDrive, pCloud, and WebDAV. Not locked to iCloud. Implement the
CloudFileSystem protocol (8 methods) to add your own.
- End-to-end encrypted — AES-256-GCM encryption before data leaves the device. No need to rely on Apple's Advanced Data Protection.
- Full Core Data fidelity — ordered relationships work. Validation rules preserved. No model compromises required.
- Transparent to your app — Ensembles observes your existing
NSManagedObjectContext saves. You don't need to change your data model or your save logic.
- Automatic conflict resolution — causal revision tracking determines the correct merge. Delegate hooks let you inspect and repair merged data before it's committed.
Ensembles vs Apple CloudKit Sync
| Feature | Ensembles | Core Data + CloudKit | SwiftData + CloudKit |
|---|
| Architecture | Local-first | Offline-first | Offline-first |
| Cloud data format | Opaque files | Structured CKRecords | Structured CKRecords |
| Cloud backends | Any (10 built-in + custom) | CloudKit only | CloudKit only |
| Custom server required | No — uses existing storage | No — but locked to Apple | No — but locked to Apple |
| Decentralized | Yes — no central authority | No — Apple servers mediate | No — Apple servers mediate |
| Ordered relationships | Yes | No | No |
| Validation rules | Fully preserved | Relaxed | All relationships optional |
| E2E encryption | Built-in (AES-256-GCM) | Requires ADP | Requires ADP |
| Custom backends | Yes (8-method protocol) | No | No |
| Conflict resolution | Revision tracking + delegate | Last-writer-wins | Last-writer-wins |
| Core Data support | Yes | Yes | N/A |
| SwiftData support | Yes | N/A | Yes |
Apple's CloudKit sync is offline-first: it works without a network connection, but Apple's servers are the central authority. Your data is stored as structured CloudKit records that Apple indexes and manages. Most other local-first frameworks avoid vendor lock-in but still require you to deploy and maintain a custom sync server — the way git requires a git server. Ensembles is different: it needs no server infrastructure at all. Any existing storage service that can hold files — Google Drive, a WebDAV share, pCloud — is enough. Data is opaque files that no server can interpret. You can encrypt everything end-to-end.
Requirements
- iOS 15+ / macOS 12+ / tvOS 15+ / watchOS 8+
- Swift 5.9+, Xcode 15+
- SwiftData features require iOS 17+ / macOS 14+
Installation
Add Ensembles 3 to your project using Swift Package Manager:
Xcode