title: Model a Q & A site in mongoDB
body: <p>I need to model a Q &amp; A site like stackoverflow in mongoDB, here are my main issues.</p>
  
  <p>I have 2 main objects - Questions and users (just forget the others like answers etc...). </p>
  
  <p>Users ask questions. I need to display the user with the question always. It is possible to search questions and browse all the questions. It safer to say that a user will ask less than 1000 questions.</p>
  
  <p>Users have a reputation which is updated frequently and the current reputation should be shown with the question all the time. </p>
  
  <p><strong>Solution 1 : Embed the users inside the questions</strong> - </p>
  
  <p>no need to perform a join but when the  users reputation changes, all the relevant questions should be updated.  And not easy to display single users</p>
  
  <p><strong>Solution 2 : Model users and question as separate collection</strong> (just like in RDBMS) - </p>
  
  <p>now updating the reputation is not an issue BUT need to do a join between users and question every time a question is retrieved. Just like in RDBMS. Furthermore mongoDB doesn't have joins and a join is actually 2 calls - 1 to get the question and another 1 to get the user, so if there are 100 questions to retrieve there'll be 100 calls to get 100 separate users - NOT GOOD.</p>
  
  <p><strong>Soluion 3 : Embed the users inside the questions and have a separate collection for users too</strong> </p>
  
  <p>When updating, update the user collection and the embedded users, when displaying only the user - use users</p>
  
  <p>So which one should I use ? or else is this best solved with a RDBMS like MySQL ?. And how fast is the field updates in mongoDB ?</p>
  
  <p>I'd love to use mongo because of its speed and easiness to route read requests to replicas and sharding (IF my site grew out of a single server which is unlikely anyway ;( )   </p>