Courseiva
Philosophy and Features →mediumMultiple Choice

C100DBA Philosophy and Features Practice Question

A social media company is using MongoDB to store user posts and comments. The application needs to retrieve a post along with its most recent comments in a single query. Which data modeling approach best aligns with MongoDB's philosophy to optimize this access pattern?

⚠ Common exam trap

The trap here is choosing to embed all comments, which seems simple but can lead to documents exceeding the 16 MB limit and causing write failures.

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

✓

Embed a subset of recent comments within the post document and store older comments separately.

The hybrid approach of embedding recent comments while storing older ones separately optimizes the common access pattern of fetching a post with its latest comments. It leverages MongoDB's flexible schema to keep frequently accessed data together, reducing query latency, while avoiding unbounded document growth. This reflects the core philosophy of modeling based on application access patterns rather than rigid normalization.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    Store comments in a separate collection and use $lookup to join them when needed.

    Why it's wrong here

    Using a separate collection with $lookup allows comments to be queried independently and avoids document growth, but it introduces a join operation that can be slower than reading a single document. For retrieving a post with its recent comments, an embedded approach is more efficient. $lookup is better suited when comments are large in number or accessed independently.

  • ✓

    Embed a subset of recent comments within the post document and store older comments separately.

    Why this is correct

    Embedding a subset of recent comments in the post document enables fast retrieval of the post with its most recent comments in a single query, which matches the application's access pattern. Storing older comments separately prevents the document from growing unbounded. This hybrid approach aligns with MongoDB's philosophy of designing for how data is accessed, balancing performance and scalability.

  • ✗

    Store comments in a separate collection and use a manual application-level join to combine them with the post.

    Why it's wrong here

    A manual application-level join requires multiple queries and additional code to merge results, which increases latency and complexity. MongoDB provides $lookup for server-side joins, but even that is slower than embedding. For the specific requirement of retrieving a post with its most recent comments, embedding a subset is more efficient and aligns with the philosophy of storing together what is accessed together.

  • ✗

    Embed all comments within the post document to ensure atomic updates and fast reads.

    Why it's wrong here

    Embedding all comments can lead to documents that grow very large, potentially exceeding the 16 MB BSON size limit, especially for popular posts. This would cause write failures and performance degradation. While atomic updates are beneficial, the unbounded growth makes this approach impractical for a social media scenario where posts can receive thousands of comments.

About these practice questions

One of 222 original C100DBA practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

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 C100DBA 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 C100DBA exam.