<!--
{
  "documentType" : "article",
  "framework" : "CoreData",
  "identifier" : "/documentation/CoreData/core-data-stack",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Core Data stack"
}
-->

# Core Data stack

Manage and persist your app’s model layer.

## Discussion

Core Data provides a set of classes that collaboratively support your app’s model layer:

- An instance of [`NSManagedObjectModel`](/documentation/CoreData/NSManagedObjectModel) describes your app’s types, including their properties and relationships.
- An instance of [`NSManagedObjectContext`](/documentation/CoreData/NSManagedObjectContext) tracks changes to instances of your app’s types.
- An instance of [`NSPersistentStoreCoordinator`](/documentation/CoreData/NSPersistentStoreCoordinator) saves and fetches instances of your app’s types from stores.

![Diagram showing that a persistent container instance contains references to a managed object model, a managed object context, and a persistent store coordinator that connects to your app’s stores.](images/com.apple.coredata/media-3118356@2x.png)

You use an [`NSPersistentContainer`](/documentation/CoreData/NSPersistentContainer) instance to set up the model, context, and store coordinator simultaneously.

## Topics

### Stack Setup

[`NSPersistentContainer`](/documentation/CoreData/NSPersistentContainer)

A container that encapsulates the Core Data stack in your app.

### Object Modeling

[`NSManagedObjectModel`](/documentation/CoreData/NSManagedObjectModel)

A programmatic representation of the `.xcdatamodeld` file describing your objects.

[`NSEntityDescription`](/documentation/CoreData/NSEntityDescription)

A description of a Core Data entity.

[`NSPropertyDescription`](/documentation/CoreData/NSPropertyDescription)

A description of a single property belonging to an entity.

[`NSAttributeDescription`](/documentation/CoreData/NSAttributeDescription)

A description of a single attribute belonging to an entity.

[`NSDerivedAttributeDescription`](/documentation/CoreData/NSDerivedAttributeDescription)

A description of an attribute that derives its value by performing a calculation on a related attribute.

[`NSRelationshipDescription`](/documentation/CoreData/NSRelationshipDescription)

A description of a relationship between two entities.

### Object Management

[`NSManagedObjectContext`](/documentation/CoreData/NSManagedObjectContext)

An object space to manipulate and track changes to managed objects.

[`NSManagedObject`](/documentation/CoreData/NSManagedObject)

The base class that all Core Data model objects inherit from.

[`NSManagedObjectID`](/documentation/CoreData/NSManagedObjectID)

A compact, universal identifier for a managed object.

### Store Coordination

[`NSPersistentStoreCoordinator`](/documentation/CoreData/NSPersistentStoreCoordinator)

An object that enables an app’s contexts and the underlying persistent stores to work together.

[`NSPersistentStore`](/documentation/CoreData/NSPersistentStore)

The abstract base class for all Core Data persistent stores.

[`NSPersistentStoreDescription`](/documentation/CoreData/NSPersistentStoreDescription)

A description object used to create and load a persistent store.

[`NSPersistentStoreRequest`](/documentation/CoreData/NSPersistentStoreRequest)

Criteria used to retrieve data from or save data to a persistent store.

[`NSPersistentStoreResult`](/documentation/CoreData/NSPersistentStoreResult)

The abstract base class for results returned from a persistent store coordinator.

[`NSPersistentStoreAsynchronousResult`](/documentation/CoreData/NSPersistentStoreAsynchronousResult)

A concrete class used to represent the results of an asynchronous request.

[`NSSaveChangesRequest`](/documentation/CoreData/NSSaveChangesRequest)

An encapsulation of a collection of changes to be made by an object store in response to a save operation on a managed object context.

[`NSAtomicStore`](/documentation/CoreData/NSAtomicStore)

An abstract superclass that you subclass to create a Core Data atomic store.

[`NSAtomicStoreCacheNode`](/documentation/CoreData/NSAtomicStoreCacheNode)

A concrete class that you use to represent basic nodes in a Core Data atomic store.

[`NSIncrementalStore`](/documentation/CoreData/NSIncrementalStore)

An abstract superclass defining the API through which Core Data communicates with a store.

[`NSIncrementalStoreNode`](/documentation/CoreData/NSIncrementalStoreNode)

A concrete class used to represent basic nodes in a Core Data incremental store.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)