DevPrep

All topics › Databases & storage

Persistent store coordinator

Middle PRO

Essence

NSPersistentStoreCoordinator (PSC) is the layer between contexts and physical stores. It knows the model (NSManagedObjectModel), holds the list of attached NSPersistentStores and translates context operations (fetch, save) into calls on a concrete store: SQL for SQLite, a file write for Binary, in-memory operations for In-Memory. A context doesn't know where the data lives — it talks only to the coordinator.

The rest of this answer, with code and interview follow-ups, is in the DevPrep app.

Read the full answer in DevPrep

Practice this before your interview

DevPrep turns these answers into one-minute challenges: what does this code print, find the bug, mock interviews. One challenge a day.

Get DevPrep on the App Store