Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<blockquote> <p>In this case ... is Core Data worth it? </p> </blockquote> <p>Yes, to the extent that you need something more centrally managed than trying to draw up your own file-system schema. Core Data, and its lower-level cousin SQL, are still the best choice for persistence that we have right now. Besides, the performance hit of using <code>NSKeyed(Un)Archiver</code> to keep serializing/deserializing a dictionary over and over again becomes increasingly noticeable with larger datasets. </p> <blockquote> <p>I think removing all the data, and inserting (populating) it, is heavier than just store the NSDictionary and replacing the old one.</p> </blockquote> <p>Absolutely, yes. But, you don't have to think about cache turnover like that. If you imagine Core Data as a static model, you can use a cache layer to ferry data in and out of the store. Need that resource about the weather? Check the cache layer. If it's not in there, make the cache run a fetch request. Need to turn over the whole cache? Have the cache empty itself then run a request to mark every entity with some kind of flag to show they are invalid. The expensive deletion you're worrying about can be done by a background process when you see that all your new data has been safely interned in the cache.</p> <blockquote> <p>Sometimes it would envolve images, textFiles, etc and the NSFileManager does it perfectly, so what advantages could Core Data bring in this cases?</p> </blockquote> <p>Unfortunately, not many. For blobs of data (which is essentially what Core Data does in these situations), storage and fetches to and from Core Data can quickly get costly. They can also take up a noticeably larger space on disk if they aren't compressed (which further decreases performance). If you need a faster alternative, use a store more suited to the task like <a href="http://fallabs.com/tokyocabinet/" rel="nofollow">Tokyo Cabinet</a> or <a href="https://code.google.com/p/leveldb/" rel="nofollow">LevelDB</a>, and use the entities in the Core Data store as a kind of stand-in that would, say, contain the key to the resource in one of those relational databases.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload