<!--
{
  "documentType" : "article",
  "framework" : "SwiftData",
  "identifier" : "/documentation/SwiftData/SchemaComponents",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Schema components"
}
-->

# Schema components

Specify the constituent parts of your schema, including entities, attributes,
and relationships.

## Topics

### Entities

[`class Entity`](/documentation/SwiftData/Schema/Entity)

An object that provides a blueprint for the associated model class.

### Attributes

[`class Attribute`](/documentation/SwiftData/Schema/Attribute)

An object that describes the configuration and behavior of a specific property of a model class.

[`class CompositeAttribute`](/documentation/SwiftData/Schema/CompositeAttribute)

An object that describes an attribute that derives its value by composing other attributes.

### Relationships

[`class Relationship`](/documentation/SwiftData/Schema/Relationship)

An object that describes the configuration and behavior of a relationship between two model classes.

### Internal

[Internal symbols](/documentation/SwiftData/SchemaComponentsInternal)

Restricted-use symbols that the framework requires for macro expansion and
other internal tasks.



---

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)