PersistenceSwiftData & Core Data2026 Engineering Reference

SwiftData vs Core Data in Production: Migration, CloudKit & WAL Matrix

Choosing between SwiftData and Core Data is one of the highest-leverage architectural decisions in a new iOS app. Because SwiftData builds on top of the Core Data SQLite stack, both share underlying WAL (Write-Ahead Logging) mechanics — yet they differ sharply in migration ergonomics and predicate expressiveness.

Production Feature Comparison

CapabilitySwiftDataCore Data
Minimum OS TargetiOS 17+ (iOS 18+ for History/Indexes)iOS 13+ (mature everywhere)
Schema DefinitionPure Swift @Model macro.xcdatamodeld XML + generated classes
Complex Custom MigrationsSchemaMigrationPlan (strict ordering)Full NSMigrationManager & mapping models
CloudKit SyncRequires optional properties & no unique constraintsNSPersistentCloudKitContainer (battle-tested)
Background Batch Writes@ModelActor isolated contextperformBackgroundTask + NSBatchInsertRequest

Safe Background Writes with @ModelActor

@ModelActor
actor SyncImporter {
    func upsertItems(_ payloads: [ItemDTO]) throws {
        for dto in payloads {
            modelContext.insert(CachedItem(id: dto.id, title: dto.title))
        }
        try modelContext.save()
    }
}

Always test schema upgrades against a real SQLite fixture exported from your previous App Store release before shipping (see Apple SwiftData Documentation).

Related Reading