title: MongoDb - Embedding or reference?
body: <p>I come from SQL relation world, and have a question that involves mongodb schema design.</p>
  
  <p>The reality that i need to represent contains:
  Users, and monthly reports (with multiple daily reports).</p>
  
  <p>I want to figure out if in mongodb, is better to embedded reports objects into the Users collection, or to have 2 separate collection referenced by id.</p>
  
  <pre><code>Embedded solution:
  User:{
       name:
       surname:
       monthlyReports: [{
                  month: "January 2014"
                  dailyReport: [{
                        day: 1
                        singleReport: [
                           { report1}, {report2}, ...
                        ]
                  }, {
                       day: 2
                       singleReport: [ 
                           { report1}, {report2}, ...
                       ]
                  }
                  ]
             },
             {
              /*
                 february 2014
                 Day 1
                 Day 2 ...
               */
             } ...
       ]
  }
  
  Referenced solution:
  Users:{
       name:
       surname:
       monthlyReports: [
               id_reportMonth1, id_reportMonth2, ...
       ]
  }
  
  MonthlyReport: {
         id:
         month:
         dailyReport: [{
                      day: 1
                      singleReport: [
                              { report1 }, { report2 } ...
                      ]
                 },
                 {
                  } ....
         ]
  }
  </code></pre>
  
  <p>For single user, i need to retrive single daily report, monthly report, and total report.</p>
  
  <p>I think that in embedded solution, querying is more simple, but create large object in a long period.</p>
  
  <p>Another possibility:
  Create 3 referenced collection:
  User, monthlyReport, dailyReport.</p>
  
  <p>What is the better way to do it?
  Someone has suggested?</p>