MongoDB has no enforced foreign keys or JOIN syntax — relationships are modeled through embedding and referencing. The right choice depends heavily on the relationship's cardinality (how many of each side exist) and access patterns.
| Cardinality | Scale | Primary Strategy | Example |
|---|---|---|---|
| One-to-One (1:1) | 1 child per parent | Embed or merge | User ↔ UserProfile |
| One-to-Few (1:few) | 2–20 children | Embed array | User → Addresses |
| One-to-Many (1:N) | Hundreds–thousands | Reference with child-side key | Post → Comments |
| One-to-Squillions (1:N+) | Millions+ | Reference + bucket/subset | Server → Log entries |
| Many-to-Many (M:N) | Both sides multiple | Array of IDs on one/both sides | Students ↔ Courses |