Embedding (Denormalization)
Store related data in one document:
{ name: "Alice", orders: [{ product: "Widget" }] }
References (Normalization)
Store IDs pointing to other collections:
{ _id: "u1", name: "Alice" }
{ user_id: "u1", product: "Widget" }
When to Embed
- Data accessed together
- One-to-few relationships
When to Reference
- Large sub-documents
- Many-to-many relationships