Objectify @Parent annotation vs Ref

277 Views Asked by At

I'm creating a pseudo social network like Facebook posts and wall using Datastore and Objectify when I try to load a user wall I find all Posts related to User using key and find the Posts related to friends and finally show the wall.

The problem is the task take so much time every time... I have a possible solution:

Add @Parent annotation to Posts related to user and when the user publish a new post create the entity and put to Datastore and:

  1. Create a copy of this post with @Parent as each friend?
  2. Create a ref key of recently created post and insert as new Post with @Parent as each friend?

What would be the best solution? My application is so slow because the Datastore queries of user friend posts.

0

There are 0 best solutions below