Is using CoreData + CloudKit to store text notes, and iCloud Document to store note image attachments as image files a good design approach?

Is using CoreData + CloudKit to store text notes and iCloud Document to store note image attachments as image files a good design approach?

Currently, I have almost finished implementing the app to store text notes as Core Data and note image attachments as image files.

I like to provide iCloud storage support to the app. I come across a few app examples

Both examples are using CoreData + CloudKit to store the image as SQLite blob binary data which CoreData will perform such task automatically)

I'm aware that when storing the binary image into CoreData, CoreData is smart enough to choose either to store it as a binary blob in SQLite, or an external file.

However, I am a little skeptical about such an approach

  1. We are using Kingfisher for smooth image loading in the collection view. If the image data are not in a regular flat-file, how can we integrate CoreData's blob data with Kingfisher?

  2. Storing images in CoreData seems like a black box. If something goes wrong in between, it is hard to debug where and how goes wrong.

  3. We like to provide alternative cloud storage (using cloud S3 storage to store SQLite files and multiple images) for the app. So, saving the image as flat files will make such an effort easier.

  4. Some related discussion on storing the image in DB vs flat files - https://stackoverflow.com/questions/3748/storing-images-in-db-yea-or-nay

I would prefer

  1. Only use CoreData + CloudKit to store the text note and file path.

  2. The image file will store in both the app folder and the iCloud document folder (so that it syncs seamlessly to iCloud). If the required images are not in the app folder (App uninstall, then re-install), the app will try to copy the image file from the iCloud document

I was wondering, anyone of you has tried such a design in your app? Do you find it is a good approach based on your experience?

Thanks.

notes maybe - images no. For images store references to their location on disk in core data, or upload them to a remote cdn or your app will be deleted very quickly when the user realize the culprit responsible for the used storage.

I'm in a very similar situation like you. Did you find any conclusions about this?

Is using CoreData + CloudKit to store text notes, and iCloud Document to store note image attachments as image files a good design approach?
 
 
Q