C100DEV Data Modeling Practice Question
A social media application stores user posts. Each post document currently embeds a comments array. A single popular post can accumulate over 50,000 comments, causing the document to grow beyond 10 MB. The development team wants to avoid hitting the 16 MB document size limit while still being able to retrieve a post with its most recent 10 comments in a single query. Which schema design should they implement?
⚠ Common exam trap
The trap here is assuming that moving all comments to a separate collection and storing an array of _ids solves the size problem, but the array of _ids itself can still grow beyond the 16 MB limit.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Keep the most recent 10 comments embedded in the post document and store older comments in a separate comments collection.
The Subset Pattern is ideal when a document contains a large array that grows indefinitely. By embedding only the most recent 10 comments, the post document remains small and the application can still fetch the post with its recent comments in one read. Older comments are stored separately, preserving access to historical data without bloating the main document.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Keep the most recent 10 comments embedded in the post document and store older comments in a separate comments collection.
Why this is correct
This approach implements the Subset Pattern: by keeping only the most recent 10 comments embedded, the post document size remains bounded and well below 16 MB. The application can retrieve the post with its recent comments in a single query, while older comments are stored separately and can be fetched on demand, balancing performance and document size.
- ✗
Move all comments into a separate comments collection and store an array of comment _ids in the post document.
Why it's wrong here
Storing an array of comment _ids in the post document still causes the post document to grow unbounded as comments accumulate, eventually hitting the 16 MB limit. Additionally, retrieving the recent comments would require an additional $lookup or application-level join, which increases complexity and does not satisfy the requirement for a single query.
- ✗
Use a capped collection for the posts collection to automatically limit document size.
Why it's wrong here
Capped collections limit the total collection size or number of documents, not the size of individual documents. They also do not allow updates that increase document size, which would break the ability to add new comments. This approach does not address the need to embed recent comments while keeping the document under 16 MB.
- ✗
Convert the comments array into a GridFS bucket and store the file reference in the post document.
Why it's wrong here
GridFS is designed for storing large binary files exceeding 16 MB, not for structured comment data. Using GridFS for comments would make querying and updating individual comments extremely inefficient and would not allow easy retrieval of the most recent comments in a single query. It is an inappropriate use of the technology.
About these practice questions
Courseiva writes every C100DEV question from scratch — 259 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official MongoDB exam blueprint
This C100DEV practice question is part of Courseiva's free MongoDB certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the C100DEV exam.