Under the Bridge

Switching from Core Data

Here’s a thoughtful piece on when not to use Core Data that’s worth reading:

… I optimized as much as I could, spent tons of time in Shark, went all multi-threaded with Core Data, switched away from my own queuing system to NSOperationQueue, optimized the XML parsing, etc. But performance and memory use on my first-generation iPod Touch (my development test device) was still not nearly good enough with a big unread count (of around 10,000 items).

At that point, having done everything else, the remaining issue was clearly Core Data. So I tried more things, re-read everything I could about Core Data performance (for the nth time), ran experiments, spent tons more time in Shark. Trying to get it good. No go.

Finally I realized I had to switch away from Core Data and use SQLite more directly. Not completely directly — I use FMDB, a lightweight Objective-C interface that works on Macs and iPhones. Gus wrote it. It’s good…

Definitely worth reading over before putting together anything with heavy data manipulation requirements, yep!

UPDATES:

Check out the other reactions that MobileOrchard collected!

On Using SQLite and FMDB Instead of Core Data

marcoarment / FCModel – “An alternative to Core Data for people who like having direct SQL access.”

Realm “is a mobile database that runs directly inside phones, tablets or wearables.”

lucascorrea/SCSQLite “is a wrapper of SQLite Objective-C for iPhone and iPad (iOS).”

Open Source iOS Library Providing A Blocks Driven Syntax For Working With SQLite Databases

Open Source Swift Based Library For Working With SQLite Databases

2