I switched PortfolioEC from SwiftData to SQLiteData over the last few weeks. I'm still working on repairing the few data persistance issues that have happened - moving from a OR-Mapped DB to plain SQL. I noticed this image and it start ringing very true... I'm now the guy in red. That midline is the version 2 (on SwiftData) transition to version 3 (on SQLiteData) of my App. Those 4 safety nets represent the unspoken infrastructure of SwiftData on iCloud.
One of the great benifets of the Apple eco-system is the professional set of systems that are backing up almost every service Apple is running. And by switching to a new data persistance layer... I've got to take that empty space below me very serious now. No one has my butt. I've got no safety rope, no stages of production. Maybe I need some advice.
SQLiteData is a new framework by the guys at Point Free. Learn more on GitHub SQLite-Data.
"A fast, lightweight replacement for SwiftData, powered by SQL and supporting CloudKit synchronization."
Let's review, what does SwiftData provide as a service layer for persistance?
Simple Setup - in Xcode add capabilities: iCloud & Background Mode (with remote notifications)
Private Database - CloudKit has a 3 tier DB: Private, Shared, Public
Automatic Syncing - cross device syncing when using same Apple ID
Schema Management - SwiftData manages schema updates
Offline Functionality - Data stored locally - synced automatically to iCloud
Persistence - Data persistent on CloudKit (iClould account)
A brief overview of SQLite-Data:
Model data types (including structs & enums)
Perform type-safe & schema-safe queries to fetch data
Leverage property wrappers (@Table, @Column, etc.)
Direct support for CloudKit sync (data distributed across all their devices)
Support iCloud Sharing (user to user sharing and associated data)
SQLite a 25 yr battle tested technology (GRDB driver)
Well documented with examples & discussion boards
SQLiteData 1.0 An alternative to SwiftData with CloudKit sync and sharing
OK - I've read all that (well skimmed most of it...) what is the answer - did I give up all Apple's service layer for SQLiteData?
- Dam it! I don't know ... yet!
Data held in: Data Model, View, Controller
Query building:
Listen to store: get notifications when data changes
Testablility: be able to hold the model in Test, not just the View.
Portable: not Apple propritary system; Sharing GRDB library;