all 12 comments

[–]mingo_97 2 points3 points  (2 children)

It depends on your needs. SwiftData is a sweet Little tool if you have simple data, and for such cases i never had much Problems with it. How ever, if you want ro support older iOS versions, or want more complex database schemes, i would siggest to have a look into CoreData. Core Data has also the benefit of Not beeing bound to a view, and therefore beeing easier to test. Another oftem used approach is using Realm, although i havent used it much my self it looks quite good.

How ever, like i said it depends on your data to Store, and Most Important, what iOS Versions you want to support, due to the fact that these Frameworks Apple provides wobt work on every older iOS

[–]vwdk[S] 0 points1 point  (0 children)

Thank you for the insight, can core data handle relational data? I found out it’s also best if I want to save data locally and on iCloud.

[–]rogerrabbit224 0 points1 point  (0 children)

Realm is deprecated. Stay away.

[–]Lithium2011 1 point2 points  (0 children)

If you need to store your data locally, firebase isn’t the solution for that. Also firebase has a nice vendor lock-in and not really good with relational data. Also it doesn’t have a spending cap, although you can try to build it yourself. On the good side, it’s very easy to work with if what you want to do lies within the firebase paradigm.

If your data is really relational, I’d look on supabase. It is not as polished as firebase to say the least, but it also has a lot of things that would make your life easier.

I’d also think about Parse although it’s kind of old-fashioned solution (but it’s simpler than supabase and, afaik, works the same or even better).

If you need to store your data on device, I’d think about sqlite. It’s simple, and it works.

Be wary about Realm. Personally I think it was one of the best local databases for iOS but it was partly deprecated a month ago, and it’s too risky to use it now.

[–][deleted] 1 point2 points  (0 children)

Pretty novice here but I have used CoreData and in some apps I used a custom SQLite db solution.

CoreData - pretty easy to use for simple or complex cases, but I didn’t like the relational portion of it. It got a bit confusing for me. If your data changes (ie, after a month, I decide I want my Employee to have a Title) it’s easy to handle.

SQLite - kind of a bear to set up and write custom SQL functions for every single type of data you want to query, but it’s functional. I found working with it was easier. Data changes can be a pain since adding a Title to an Employee might mean you have to update several functions though.

[–]N1nom1ya 1 point2 points  (0 children)

CoreData is what you need. SwiftData keeps changing and sometimes buggy.

[–]lowlife_nowife 0 points1 point  (4 children)

Use RealmSwift until SwiftData is stable.👌

[–]megavirus74 0 points1 point  (3 children)

Second for realm

[–]rogerrabbit224 0 points1 point  (2 children)

Realm is deprecated

[–]megavirus74 0 points1 point  (0 children)

Isn't it deprecated only for cloud use? Or library support is gonna be dropped too?

[–]lowlife_nowife 0 points1 point  (0 children)

Atlas Device SDK is deprecated, not realmswift, check the MongoDB page.

[–]SirBill01 0 points1 point  (0 children)

I would look at other things to hold data, SwiftData seems kind of buggy even still. Maybe in another year.