title: Why does MongoDB takes up so much space?
body: <p>I am trying to store records with a set of doubles and ints (around 15-20) in mongoDB. The records mostly (99.99%) have the same structure.</p>
  
  <p>When I store the data in a <a href="http://root.cern.ch/drupal/content/root-files-1" rel="noreferrer">root</a> which is a very structured data storing format, the file is around <strong>2.5GB</strong> for <strong>22.5 Million</strong> records. For Mongo, however, the database size (from command <code>show dbs</code>) is around <strong>21GB</strong>, whereas the data size (from <code>db.collection.stats()</code>) is around <strong>13GB</strong>. </p>
  
  <p>This is a huge overhead (<strong>Clarify: 13GB vs 2.5GB, I'm not even talking about the 21GB</strong>), and I guess it is because it stores both <code>keys</code> and <code>values</code>. So the question is, why and how <strong>Mongo</strong> doesn't do a better job in making it smaller? </p>
  
  <p>But the main question is, what is the performance impact in this? I have 4 indexes and they come out to be <strong>3GB</strong>, so running the server on a single 8GB machine can become a problem if I double the amount of data and try to keep a large working set in memory.</p>
  
  <p>Any guesses into if I should be using SQL or some other DB? or maybe just keep working with ROOT files if anyone has tried them?</p>