Basically, I'm writing an iOS app that makes use of a huge database that will not be edited at all. Between these two, I'm looking for faster query speeds. I have never used any SQLite or Core Data in my developing lifetime, so before I take a dive writing anything, I want to find out which of these (or if any alternatives) would be better for my task.
Any performance data or suggestions would be greatly appreciated.
Edit: Neither SQLite nor Core Data was able to deliver the performance I needed (although SQLite performed better). I decided to go with SQLite (with FMDB) and use multi-threading to get rid of stutters that occur when querying multiple times.
Core Data is heavily optimized with regards to caching, lazy-loading and memory management. If you use it (with the SQLite store type), especially in conjunction with NSFetchedResultsController, you should get better performance than you could get with SQLite on your own.
The most important difference between Core Data and SQLite is that SQLite is a database while Core Data is not. That is the most important difference because there is very little to compare. Core Data and SQLite are solutions to different problems.
Realm uses its own engine, simple and fast. Thanks to its zero-copy design, Realm is much faster than ORM, and often faster than SQLite either.
Core Data is incredibly fast if you consider what it does under the hood to do its magic. But Realm is faster, much faster. Realm was built with performance in mind and that shows. As Marcus Zarra once said in a presentation, you don't choose Core Data for its speed.
It depends on how you want to manage your data, if you want a relational database, use sqlite and if you want to save model objects (in the sense of the model-view-controller design pattern) to a file and get them back again, use Core Data.
According to me both are same for large database, in sqlite you can use transactions for getting huge data faster.
This link might helps you better.
Hope this helps you..
For me I will always use core data whenever possible. As it is easy to use and manage. For more you can check these links
Here are good tutorials of Ray Wenderlich on Core Data
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With