Resource
Purpose
A Resource describes data associated with another structure.
Resources may be used to define available resources or to reference a specific resource.
The Canonical Data Model defines the structure of a Resource but does not define the available Resource types.
Storage ownership is separate from application ownership. A service may own the object or document that refers to a Resource, while Storage owns the Resource bytes and canonical Resource metadata.
---
Structure
A Resource consists of:
id- Identifies the Resource.type- Classifies the Resource.content- Contains the data associated with the Resource.
The interpretation of content is determined by type.
When a Resource references stored bytes, content may be represented by retrieval information rather than embedded bytes. That retrieval information must not expose Storage's internal filesystem path or backing implementation.
Stored byte Resources additionally expose metadata:
length- The byte length of the Resource content.sha256- The SHA-256 digest of the Resource content.owner- The member or service that owns access to the Resource.created- The creation timestamp.modified- The metadata modification timestamp.
---
Characteristics
- Resources are independent.
- Resources may contain any valid data.
- Resources are immutable.
Resource immutability means a Resource identifier must not be reused for different content. Replacing content creates a new Resource. A service that owns a document, object, attachment, avatar, or other domain structure decides which Resource is current for that structure.