I went down the path of trying to define a source agnostic schema, thinking I would transform all the incoming data to a common record type in the macOS app before loading it into CloudKit.

Architecture diagram: records from 3 data sources are mapped to a unified agnostic schema and then pushed to CloudKit.

But this adds some pressure to get the data normalization “right” on ingest. Now I’m exploring an alternative approach, where I maintain a 1:1 relationship between data source schemas and CloudKit record types.

Architecture diagram: records from 3 data sources are each mapped to their own record type and then pushed to CloudKit, maintaining the schema of each source.