In MongoDB, when is embedding a sub-document usually better than referencing another collection?
- Grows without any upper limit
- Read together, small and bounded
- Shared by many parent documents
- Updated far more than it is read
Embed data that is fetched with its parent and stays small; reference data that is shared or unbounded (16 MB doc limit).
Play SQL & Databases ▸