Dr. Dobb's is part of the Informa Tech Division of Informa PLC

This site is operated by a business or businesses owned by Informa PLC and all copyright resides with them. Informa PLC's registered office is 5 Howick Place, London SW1P 1WG. Registered in England and Wales. Number 8860726.


Welcome Guest | Log In | Register | Benefits
Channels ▼
RSS

Database

iOS Data Storage: Core Data vs. SQLite



Related Reading


More Insights




alexvidal

Thanks for the great information on ios data storage. This was not understandable to me when I was trying to use vshare pro app on phone Now it is clear http://vsahreprodownload.com

KonranG583

Thanks for your great article - that was exactly that what I needed to understand and use CoreData for the first time.
One remark on your sample test application:
The results table view shows elapsed time for each row displayed. As you are caching/pre-fetching the data (either Sqlite or CoreData) prior to feed it into the table view, this time value is obsolete. I experienced by writing own test code, that a test without pre-fetching the data, but executing SQL or object retrieval code for each cellForRowAtIndexPath: gives interesting results:
One single Sqlite SQL execution and unpacking the column data takes approx. 2 ... 13 micro secs while one single CoreData object retrieval and parameters unpacking takes approx. 65 ... 90 milli secs. Measurements were taken on iPhone 6, 1 of 13134 data records, SQL statement with 3 table joins vs. CoreData fetch request with search predicate also on 1 of 13134 objects in storage.
Thus, a scroll in the results table view takes a noticeable time using CoreData and no delay with Sqlite. CoreData seems to offer advantage, when lots of data rows are retrieved at the same time.