- Core data is a framework to manage you data graph, not a database. It support data being saved as XML, binary, SQLite and Memory.
- One app could have multiple data stores, because for some cases, some data need to store in memory, some need to store in SQLite, etc.
- Managed object can't be passed crossing thread, but you can do it by using its ManagedObjectID.
- MOC(Managed Object Context) - the data change is only propagated from child to parent and not the other round, and not propagated between siblings.
- Multiple thread (concurrency) supports - main queue and private queue in background thread, you have to use perform related methods to save the change if it's in a private queue.
- Merge types: as the data may be reading and writing in multiple thread, you should choose data merge type for data propagating. Types includes: trump memory, trump object, override, discard.
- Memory and performance
- Specify the fields only that you desire.
- Result limitation.
- Decrease fault overhead by using batch faulting and prefetching.
- Check and manage you data in memory like using reset method, etc.
https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/CoreData/Performance.html#//apple_ref/doc/uid/TP40001075-CH25-SW1
Friday, April 26, 2019
[iOS] - Core Data Notes
Labels:
iOS
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment