Courseiva
Data Modeling →hardMultiple Select

C100DEV Data Modeling Practice Question

A development team is designing a schema for a chat application where each conversation contains messages that grow continuously. Messages are read in chronological order, and the application must display the most recent 50 messages quickly while retaining the full history. Which TWO design decisions best support these requirements? (Choose two.)

⚠ Common exam trap

The trap here is assuming embedding must be all-or-nothing, when a bounded embedded subset combined with a full referenced collection satisfies both speed and retention.

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 only the most recent 50 messages in the conversation document and store the full history in a separate collection.

The requirements split into two needs: fast access to recent messages and complete retention of history. Referencing messages in a dedicated collection with an indexed timestamp satisfies retention and efficient recent-message queries, while the Subset Pattern's bounded embedded window gives the fastest possible read for the latest 50. Together they keep conversation documents small and preserve the full message log without hitting the 16MB limit.

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 each message as its own document in the conversations collection using a message-specific discriminator field.

    Why it's wrong here

    Mixing messages and conversation documents in one collection with a discriminator would make conversation-level queries scan past many message documents unless carefully indexed, and it complicates the natural one-to-many relationship. It also provides no inherent benefit over a dedicated messages collection, and the discriminator adds overhead without solving the growth or recent-message access requirements.

  • ✓

    Embed only the most recent 50 messages in the conversation document and store the full history in a separate collection.

    Why this is correct

    This is the Subset Pattern applied to chat: the conversation document holds a bounded, frequently accessed window of recent messages, so displaying the latest 50 requires no additional query. The separate collection retains every message for history and pagination. The bounded array keeps conversation documents small and predictable, avoiding the 16MB problem entirely.

  • ✗

    Embed messages in the conversation document and rely on the 16MB limit to naturally cap growth.

    Why it's wrong here

    Relying on the 16MB limit as a cap is not a design decision; it is a failure mode. Once the embedded array approaches the limit, writes to that conversation begin to fail, and the application has no clean way to continue appending messages. This option neither preserves full history nor guarantees fast access to recent messages.

  • ✓

    Store messages in a separate collection with a reference to the conversation and an indexed timestamp field.

    Why this is correct

    A separate messages collection removes unbounded growth from the conversation document and preserves the complete history. An index on conversation identifier plus timestamp lets the application retrieve the most recent messages efficiently using a descending sort and limit, satisfying the requirement to display the latest 50 quickly while still supporting older-history queries.

  • ✗

    Store all messages in a single capped collection so older messages are automatically overwritten.

    Why it's wrong here

    A capped collection would automatically discard older messages, directly violating the requirement to retain full history. While capped collections offer predictable performance for recent data, they are unsuitable when historical retention is mandatory. The application would lose messages permanently and could not satisfy audits or user requests to scroll back through a conversation.

About these practice questions

This C100DEV question is part of Courseiva's 259-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. 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 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.