title: When to use MongoDB
body: <p>I'm writing an application that doesn't necessarily need <strong>scaling abilities</strong> as it won't be collecting large amounts data at the beginning. (However, if I'm lucky, I could down the road potentially.)</p>
  
  <p>I will be running my web server and database on the same box (for now).</p>
  
  <p>That being said, I am looking for performance and efficiency. </p>
  
  <p>The main part of my application will be loading blog articles. Using an RDBMS (MySQL) I will make 6 queries (2 of the queries being joins), just to load a single blog article page. </p>
  
  <pre><code>select blog
  select blog_album
  select blog_tags
  select blog_notes
  select blog_comments (join with users)
  select blog_author_participants (join with users)
  </code></pre>
  
  <p>However, with <a href="http://en.wikipedia.org/wiki/MongoDB" rel="noreferrer">MongoDB</a> I can de-normalize and flatten 6 tables into just 2 tables/collections and minimizes my queries to potentially just one 1 query,</p>
  
  <pre><code>users
  blogs
      -&gt;blog_album
      -&gt;blog_tags        
      -&gt;blog_notes
      -&gt;blog_comments
      -&gt;blog_author_participants
  </code></pre>
  
  <p>Now, going with the MongoDB schema, there will be some data redundancy. However, hard drive space is cheaper than CPU/servers. </p>
  
  <p>1.) Would this be a good scenario to use MongoDB? </p>
  
  <p>2.) Do you only benefit in performance using MongoDB when scaling beyond a single server?</p>
  
  <p>3.) Are there any durability risks using MongoDB? I hear that there is potential for loss of data while performing inserts - as insert are written to memory first, then to the database.</p>
  
  <p>4.) Should this stop me from using MongoDB in production?</p>