# Embed or Reference

Embed or Reference: Embedding: Keeping Related Data Together, Referencing: Linking Documents by \_id, Choosing by Relationship: One-to-Few, One-to-Many,…

Updated: November 19, 2026

1. [Embedding: Keeping Related Data Together](https://www.ask-codey.com/lessons/mongodb-embedding-documents) (Apprentice): Embedding puts related data inside the document that uses it, like an order's line items and shipping address, so one read gets everything and one write saves it all at once, within a 16 MB limit per document.
2. [Referencing: Linking Documents by \_id](https://www.ask-codey.com/lessons/mongodb-referencing-documents) (Apprentice): Referencing links two documents by storing one's \_id in the other, like a customerId in each order, so shared or changing data lives in one place, at the cost of a second query to follow the link.
3. [Choosing by Relationship: One-to-Few, One-to-Many, Many-to-Many](https://www.ask-codey.com/lessons/mongodb-choosing-by-relationship) (Journeyman): How many documents sit on each side of a relationship points to its model; embed a few, reference from the many side, never keep an array that grows without end, and link many-to-many with an array of ids.

Source: https://www.ask-codey.com/courses/mongodb-in-depth/topics/mongodb-embed-or-reference
