Issues with Data Quantities

As discussed in Under the Hood, Core Data uses transaction logs to keep multiple persistent stores in sync with each other. Because of that design and because of the latency of networking, there’s an upper limit to the frequency in which we can create entities and save them to our Core Data application. The exact numbers are difficult to determine, but it’s safe to say that if we’re generating hundreds of entities per save, we may run into a performance problem.

Whenever we create an NSManagedObject and save the NSManagedObjectContext or the UIManagedDocument, a transaction log is created for that instance. The more entities we create, the larger that transaction log becomes. There’s an upper threshold whereby the ...

Get Core Data in Swift now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.