Modelling for MongoDBs
MongoDB data modelling is the design of document shapes around how the application reads and writes data. The key choice is embedding related data inside one document or referencing it by _id from another collection. This unit sits in the Data Modelling stage and covers patterns such as bucket, subset and computed values.
Stage: Data Modelling · Part of the MongoDB roadmap · Last reviewed 19 November 2026
What to learn in Modelling
- Decide whether to embed or reference using cardinality and access patterns
- Avoid unbounded arrays that grow without limit inside a document
- Model one-to-many and many-to-many relationships
- Apply the subset or bucket pattern to keep documents small
- Estimate document size against the 16 MB document limit
Modelling interview questions
When should you embed instead of reference in MongoDB?
Embed when data is read together, the related data is bounded and mostly belongs to one parent, because a single read returns everything. Reference when the related data is large, shared across parents or changes independently, to avoid duplication and oversized documents.
Why does MongoDB schema design start with queries?
Because MongoDB has no joins by default for every read, the best structure depends on how the application accesses data. Designing around the most frequent queries lets a single document fetch answer them. A normalised structure copied from SQL often performs poorly.
Where Modelling fits in the MongoDB roadmap
Modelling belongs to the Data Modelling stage (intermediate level), which takes about 12 hours. Design for access patterns.
Other units in this stage
Back to the full MongoDB roadmap