Best Practices to Store Multiple Photos Per Entry in SwiftData

Hello everyone,

I am currently developing an app using SwiftUI and SwiftData. In my app, I need to store about three photos per entry. But as the number of entries grows, I run into significant performance issues, especially with RAM and CPU utilization. The app slows down as the dataset grows.

I'm wondering what would be the best approach to deal with this. Should I continue to store the photos locally using SwiftData, or would it be better to upload them to a server (like AWS S3 or Firebase Storage) and store only the URLs in SwiftData?

I also want to implement caching to improve performance, what would be the best methods or practices for caching these images?

I would be very grateful for any advice or suggestions from the community.

Thank you in advance!

Answered by DTS Engineer in 799761022

I believe this topic was discussed in the following post:

You might take a look to see if that helps.

Best,
——
Ziqiao Chen
 Worldwide Developer Relations.

I believe this topic was discussed in the following post:

You might take a look to see if that helps.

Best,
——
Ziqiao Chen
 Worldwide Developer Relations.

Best Practices to Store Multiple Photos Per Entry in SwiftData
 
 
Q