Referencing (Normalization)
← Back to DP-420 Terminology Reference
Category: Data Modeling & Partitioning
Summary: Storing related entities as separate documents linked by an id reference.
Overview
Referencing is a data modeling technique where related entities are stored as separate documents (potentially in separate containers), with one document holding a reference (an id or foreign key-like property) to the other. It's preferred when related data changes independently, is large, is shared across many parent entities, or has a 1:many or many:many relationship that would make embedding impractical.
More Info & Links
DP-420 Style Practice Questions
Q1. When is referencing (normalizing) preferred over embedding in Azure Cosmos DB data modeling?
- A. When related data changes independently, is large, or is shared across many parents
- B. When the related entities are always retrieved together
- C. When minimizing the number of read round-trips is the top priority
- D. When the relationship is strictly 1:1 and small
Q2. What is a trade-off of using referencing instead of embedding?
- A. It may require multiple round trips (and more RUs) to retrieve related data
- B. It always reduces the total storage used
- C. It removes the need for a partition key
- D. It guarantees strong consistency automatically
Answer Key
Answers are listed at the very end so you can attempt the questions first.
- Q1 (Referencing (Normalization)): A. When related data changes independently, is large, or is shared across many parents — Referencing suits data with independent lifecycles, large size, or many-to-many/shared relationships.
- Q2 (Referencing (Normalization)): A. It may require multiple round trips (and more RUs) to retrieve related data — Referencing requires additional queries/round trips to join related documents, unlike embedding.
DP-420: Designing and Implementing Cloud-Native Applications Using Microsoft Azure Cosmos DB — term detail page