Hacker News new | ask | show | jobs
by nathanwdavis 4310 days ago
What's the advantage of using something like this over CoreData - which is built in?
4 comments

Personally, I find the CoreData API unpleasant to use ... I think SwiftData offers simplicity and the familiarity of SQL to developers.

But CoreData is a great option if you have time to learn it!

SQLite ships with iOS and OSX too, just like Core Data. All you have to do is link libsqlite3.dylib instead of CoreData.framework.
I've had the same thoughts and internal discussions a few times. I recently found these two articles, one talking about using NSCoding instead of CoreData, and the other is about helper libraries to make CoreData easier to manage. Both are good reads if you're working on iOS apps.

http://nshipster.com/nscoding/

http://nshipster.com/core-data-libraries-and-utilities/

CoreData actually has the option of using SQLite as the underlying datastore. The other alternative is a proprietary binary store. I think there is also an XML store. CoreData is an abstraction level higher than SQLite. It's similar to an ORM or graph database where it manages the relationships between objects for you. So if you don't need all the features of CoreData, SQLite is lighter and simpler.
SQLite is the default storage engine for CoreData.