title: Fragmentation in MongoDB when growing documents
body: <p>Seems like a blog with comments is the standard example used for describing different modeling strategies when using MongoDB.</p>
  
  <p>My question relates to the model where comments are modeled as a sub collection on a single blog post document (i.e one document stores everything related to a single blog post). </p>
  
  <p>In the case of multiple simultaneous writes it seems like you would avoid overwriting previous updates if you use upserts and targeted update modifiers (like push). Meaning, saving the document for every comment added would not overwrite previously added comments.
  However, how does fragmentation come into play here? Is it realistic to assume that adding multiple comments over time will result in fragmented memory and potentially slower queries? 
  Are there any guidelines for growing a document through sub collections?</p>
  
  <p>I am also aware of the 16MB limit per document, but that to me seems like a theoretical limit since 16 MB would be an enormous amount of text. 
  In the event of fragmentation, would the documents be compacted the next time the mongo instance is restarted and reads the database back into memory?</p>
  
  <p>I know the way you expect to interact with the data is the best guiding principle for how to model the data (needing comments without the blog post parent etc). However I am interested in learning about potential issues with the highly denormalized single document approach. Are the issues I'm describing even realistic in the given blog post example?</p>