intermediateMongoDB Schema Design — Embedding vs. Referencing
What three questions should decide whether to embed or reference a piece of related data in MongoDB?
Is this data always read together with its parent? Does the embedded data risk growing unboundedly (threatening the 16MB document limit)? Is the related data shared across many parents and updated independently of them? Embedding fits data that's always read together and naturally bounded; referencing fits data that's shared and updated independently.
This is a Pro chapter
Sign in, then upgrade to Pro or Power to unlock this and the full Databases Mastery library.
What three questions should decide whether to embed or reference a piece of related data in MongoDB?