I'm writing an app on Google App Engine to help me learn it better. I'm persisting my data in the Datastore.
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:
class Story {
Comment[] comments;
...
}
class Comment {
User[] likes;
User[] hates;
...
}
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.
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.
How would this handle a story with hundreds of comments, each with hundreds of thousands of votes?!
What is a common way of modeling such a concept in NoSQL?