MySQL Forums
Forum List  »  Docs

What do you all think
Posted by: Andy Edwards
Date: January 31, 2010 12:41PM

I'm writing a simple forum-like application on Google App Engine and trying to avoid scalability issues. I'm new to this non-RBDMS approach, i'd like to avoid pitfalls from the beginning.
The forum design is pretty simple, posts and replies will be the only concepts. What will be the best approach to the problem if the forum have millions of posts?

The model so far (stripped from useless properties):

class Message(db.Model):
user = db.StringProperty() # will be a google account user_id
text = db.TextProperty() # the text of the message
reply_to = db.SelfReferenceProperty() # if null is a post, if not null a reply (useful for reply-to-reply)

Splitting the model, i think it's faster because it will query less items when retrieving "all posts":

class Post(db.Model):
user = db.StringProperty() # will be a google account user_id
text = db.TextProperty() # the text of the message

class Reply(db.Model):
user = db.StringProperty() # will be a google account user_id
text = db.TextProperty() # the text of the message
reply_to = db.ReferenceProperty(Post)

This is a many-to-one relation in a RDBMS world, should a ListProperty be used instead? If so, how?

Edit:

Jaiku uses something like this

class StreamEntry(DeletedMarkerModel):
...
entry = models.StringProperty() # ref - the parent of this, should it be a comment
...

Options: ReplyQuote


Subject
Views
Written By
Posted
What do you all think
3880
January 31, 2010 12:41PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.