3 ms·
I really hope Apple will come up with a modern alternative to Core Data; it's neat and all, but it just doesn't feel like it's a good match for most situations.
by Cthulhu_ 12y ago
I really hope Apple will come up with a modern alternative to Core Data; it's neat and all, but it just doesn't feel like it's a good match for most situations.
In my own anecdote, we had to show a list of autocompletion items - simple enough. Read XML, write a few hundred entries to a Core Data storage - and this list was relatively static, updated only once a week.
A week after release, we got crash reports - the XML read and store in CoreData was still running while people were already accessing the autocomplete list. It took (IIRC) 10 - 15 seconds to run (on an old iPhone 3GS), which was far too long from any standpoint.
So we just tossed CoreData, stored the list as a simple in-memory list, and made the autocomplete match search a very naive iteration-based search. Ten times faster, if not more.
TL;DR I would avoid CoreData, unless it's relatively static and non-time-critical data. And even then I'd look for alternatives first.
- smackfu 12y agoCoreData is really meant for storing the entries that back your table view. Trying to use it as a universal data model seems unintended.
- gress 12y agoYou might be right that it's best for that, but CoreData pre-dates table views by many years and has always been sold by Apple as a general store for object graphs.
- mikeash 12y agoCore Data lives in an unfortunate in between world. It's way too complicated for small amounts of data, and it's too slow for large amounts of data. It's useful if you have medium amounts of data, such that you can't reasonably keep everything in memory and rewrite everything to disk for serialization but don't have so much that you start to hit performance problems, but how often are you in a situation like that where you know your data won't grow larger?
- christop 12y ago> I really hope Apple will come up with a modern alternative to Core Data; it's neat and all, but it just doesn't feel like it's a good match for most situations. This pretty much seems to be the aim of the (non-Apple) http://realm.io/ http://realm.io/