intermediate~3h
MongoDB Schema Design — Embedding vs. Referencing
The single recurring decision in MongoDB schema design is whether related data should be embedded inside its parent document or referenced by ID in its own collection — and getting it wrong shows up as either slow joins or a rejected 16MB write.
Learning objectives
- State the three deciding questions for choosing embedding versus referencing for a given relationship.
- Explain why an unbounded embedded array is a design risk, tied specifically to MongoDB's 16MB document limit.
- Describe the denormalized-snapshot hybrid pattern and when it beats a pure embed or pure reference design.
This is a Pro chapter
Sign in, then upgrade to Pro or Power to unlock this and the full Databases Mastery library.
MongoDB Schema Design — Embedding vs. Referencing