How would you design an AppEngine datastore for a social site like Twitter?

后端 未结 4 1371
野性不改
野性不改 2020-12-12 09:41

I\'m wondering what would be the best way to design a social application where members make activities and follow other member\'s activities using Google AppEngine.

4条回答
  •  悲&欢浪女
    2020-12-12 10:34

    Robert, about your proposed solution:

    messages = Message.query(Message.receivers == user_id).fetch(projection=[Message.body])
    

    I think the ndb.TextProperty "body" can't be used with projections because is not indexed. Projections only support indexed properties. The valid solution would be to maintain the 2 tables: Message and MessageIndex.

提交回复
热议问题