Forum Data Modeling Guidelines for the Google App Engine

I am writing a simple forum-like application in the Google App Engine and trying to avoid scalability issues. I am new to this non-RBDMS approach, I would like to avoid errors from the very beginning.
The design of the forum is quite simple, messages and answers will be the only concepts. What would be the best approach to the problem if the forum has millions of posts?

While the model (devoid of 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, is faster, because it will request fewer elements when receiving "all messages":

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 has a lot to do with one in the RDBMS world, should 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  
...
+3
2

-, user = db.UserProperty() user = db.StringProperty()?

-, , , , , :

  • KISS ( )
  • ,

, , .

, , SQL Google, , , , , , -, .

+2

, php- . , PHP, .

, , , . . - , .

-2

Source: https://habr.com/ru/post/1728784/


All Articles