Data Model Examples and Patterns
The following documents provide overviews of various data modelingpatterns and common schema design considerations:
- Model Relationships Between Documents
Examples for modeling relationships between documents.
- Model One-to-One Relationships with Embedded Documents
- Presents a data model that uses embedded documents to describe one-to-one relationshipsbetween connected data.
- Model One-to-Many Relationships with Embedded Documents
- Presents a data model that uses embedded documents to describe one-to-manyrelationships between connected data.
- Model One-to-Many Relationships with Document References
- Presents a data model that uses references to describe one-to-manyrelationships between documents.
- Model Tree Structures
Examples for modeling tree structures.
- Model Tree Structures with Parent References
- Presents a data model that organizes documents in a tree-likestructure by storing references to “parent” nodes in “child”nodes.
- Model Tree Structures with Child References
- Presents a data model that organizes documents in a tree-likestructure by storing references to “child” nodes in “parent”nodes.See Model Tree Structures for additionalexamples of data models for tree structures.
Examples for models for specific application contexts.
- Model Data for Atomic Operations
- Illustrates how embedding fields related to an atomic updatewithin the same document ensures that the fields are in sync.
- Model Data to Support Keyword Search
- Describes one method for supporting keyword search by storingkeywords in an array in the same document as the text field.Combined with a multi-key index, this pattern can supportapplication’s keyword search operations.