In CloudKit dashboard, it shows that the data size is 100 kilobytes - as it should.
The device's local storage increase by 100 kilobytes - as expected.
However, I check the user's iCloud storage (in Settings>Apple ID>iCloud>Manage Storage). The app's storage in crease by approximately 1 megabytes. Larger by a factor of 10!
I try uploading the same image to a test asset field via CloudKit Dashboard. The user's iCloud storage increase by 100 kilobytes - as expected.
Why the data (bytes) field take up more of user's iCloud quota than asset field?
I really prefer to directly store as data rather than as a CKAsset.
Is this just the way it is... or a bug?
I just noticed this long-time thread, thanks to the folk who contacted DTS and mentioned this thread.
I'd like to confirm that a BYTES field consuming much more iCloud storage usage is intentional, and that’s because the way to store and manage BYTES fields is quite different from that of CKAsset – it’s much more expensive.
When you use NSPersistentCloudKitContainer, you don't control when and if a Core Data attribute should be converted to CKAsset when the attribute is exported to CloudKit, and so what I can suggest is that you file a feedback report for an API that allows the configuration – If you do so, please share your report ID here.
If the issue is something needs to be addressed immediately, you can probably consider using CKSyncEngine to implement your data synchronization. That way, you control the CloudKit schema, and can choose CKAsset for fields that can have a larger size, and avoid using BYTES that consumes more CloudKit usage.
Best,
——
Ziqiao Chen
Worldwide Developer Relations.