title: Efficient NoSQL modeling in Google App Engine Datastore
body: <p>I'm writing an app on Google App Engine to help me learn it better. I'm persisting my data in the Datastore.</p>
  
  <p>The application is models similar to StackOverflow: You have a Story entity, which has a collection of Comment entities, which in turn can be liked/hated by many users. The way I'm modeling this right now is as follows:</p>
  
  <pre><code>class Story {
      Comment[] comments;
      ...
  }
  
  class Comment {
      User[] likes;
      User[] hates;
      ...
  }
  </code></pre>
  
  <p>So when you load a given story, you can list all the comments, plus the percentage of likes and hates for each comment. You can also keep track of whether or not a given user has voted for a comment or not.</p>
  
  <p>I'm assuming I can lazy load all the actual users in the Comment entity, but even then, I kind of get the idea that there's a better way of doing this. </p>
  
  <p><strong>How would this handle a story with hundreds of comments, each with hundreds of thousands of votes?!</strong></p>
  
  <p><strong>What is a common way of modeling such a concept in NoSQL?</strong></p>