Not Every Box Fits Under the Bed: Document Size Limits and When to Split

September 13, 2026 · Part 7 of 20

Opening Scene

A mover determined to keep everything from one room in a single box eventually hits a real, physical wall: the box becomes too heavy to lift safely, too large to fit through the door, genuinely impractical regardless of how logically related its contents might be. At some point, no matter how tempting it is to keep one thing embedded with another, the box itself imposes a hard, practical limit that has to be respected.

Document size limits in a document database impose this exact same hard, practical constraint.

In Plain English

Every document database enforces a maximum document size — commonly a few megabytes — and a document that grows unbounded, typically because it keeps accumulating an embedded array that has no natural limit, will eventually hit that ceiling. Recognizing this risk in advance, and designing around it deliberately, is a genuinely necessary part of document modeling, distinct from but closely related to the embedding decisions covered in Article 2.

The Old Way

Recognizing which embedded relationships risk unbounded growth has always required looking ahead at a relationship’s genuine, real-world growth pattern, not just its logical shape today:

  • An embedded array with a natural, bounded size — a handful of line items in a typical order, for instance — is usually a genuinely safe embedding choice, since it won’t realistically grow to threaten a document size limit.
  • An embedded array with unbounded growth potential — every comment ever posted on a popular article, every event ever logged for a long-lived user account — is a genuine risk, since nothing structurally prevents it from eventually exceeding a document’s practical size limit.
  • The correction for unbounded embedded growth is usually to convert that relationship to a reference, covered in Article 3, moving the unbounded collection into its own separate collection rather than continuing to embed it inside a single, ever-growing parent document.

Getting this right has always meant genuinely projecting a relationship’s realistic growth over an application’s real lifetime, not just assessing whether it looks embeddable based on today’s typical, modest volume.

What’s Changing (and Why AI Is the Reason)

  1. AI-assisted growth projection can analyze a relationship’s actual historical growth pattern and estimate whether it genuinely risks approaching a document size limit, informing embedding decisions with real evidence rather than an assumption based on today’s typical case. Rather than a modeler eyeballing a “usually small” embedded array and assuming it’ll stay that way, AI-assisted analysis of how similar relationships have actually grown over time can flag a genuine long-term risk before it becomes a production incident.
  2. AI-assisted document restructuring can propose converting a genuinely at-risk embedded relationship to a reference, informed by the specific growth pattern that made it risky, applying the correction pattern covered throughout this series with concrete, evidenced justification. This connects directly to the referencing pattern from Article 3, applied specifically to the document size risk this article addresses.
  3. AI agents writing to a document database need to correctly understand a document’s size constraints to avoid generating a write operation that fails unexpectedly when a size limit is finally hit, particularly for an embedded array an agent might otherwise treat as safely unbounded. Clear schema metadata flagging genuinely bounded versus potentially unbounded embedded relationships helps an agent write data safely, rather than discovering the limit only through a failed operation.

The Metaphor, Fully Extended

Moving Company ElementDocument Size Limit Concept
A box that becomes too heavy to lift or too large to fit through the doorA document exceeding the database’s maximum practical size limit
A handful of small, related items that will never realistically overflow their boxAn embedded array with a natural, bounded size, a genuinely safe embedding choice
An ever-growing pile of mementos with no natural stopping pointAn embedded array with unbounded growth potential, a genuine document size risk
Moving an ever-growing collection into its own separate storage unit rather than continuing to cram it into one boxConverting an at-risk embedded relationship to a reference in its own separate collection
A moving company studying years of past moves to identify which item categories tend to accumulate without boundAI-assisted growth projection identifying relationships that genuinely risk approaching a document size limit

For Beginners: What to Actually Do

  • Practice checking any embedded array for genuine, realistic growth potential over an application’s real lifetime, not just its typical size today.
  • Get comfortable with the basic rule of thumb: a bounded, naturally small embedded relationship is usually safe; an unbounded one is a genuine risk worth converting to a reference.
  • Before finalizing an embedding decision, ask what would happen to this document if the embedded data kept growing indefinitely, with no natural ceiling.
  • Notice that document size limits are a hard, practical constraint imposed by the database itself, not a theoretical concern to deprioritize.

For Practitioners and Leaders: The Deeper Layer

  • Use AI-assisted growth projection to identify embedded relationships that genuinely risk approaching a document size limit, based on real historical growth patterns rather than assumption.
  • Use AI-assisted document restructuring to propose converting at-risk embedded relationships to references, with concrete evidence justifying the correction.
  • Maintain clear schema metadata flagging genuinely bounded versus potentially unbounded embedded relationships, helping AI agents write data safely and avoid unexpected failures.
  • Build document size risk assessment into your standard document design review process, treating unbounded embedded growth as a genuine, foreseeable risk rather than a surprise discovered in production.

Quick Recap

  • Every document database enforces a maximum document size, and an embedded relationship with unbounded growth potential genuinely risks eventually exceeding it.
  • A bounded, naturally small embedded array is usually a safe choice, while an unbounded one should typically be converted to a reference instead.
  • AI-assisted growth projection can identify genuinely at-risk relationships from real historical patterns, and AI-assisted document restructuring can propose the correction with concrete evidence.
  • AI agents need clear metadata distinguishing bounded from potentially unbounded embedded relationships to write data safely and avoid unexpected failures.

Where This Fits in the Series

Article 6 covered the reality of drifting labels over time. This article covered the hard, practical limit every box eventually hits. Article 8 looks at the moving crew’s manifest — collections and indexes.