0

My site on GAE allows people to create postings. It also allows people to edit postings and review them.

Users should be able to retrieve a list of postings they have created, list of postings they have edited and a list of postings they have reviewed. Also, it would be nice to be able to view all reviews for a product.

Two solutions present themselves and I was wondering as to the pros and cons of each:

Solution 1: in user object/entity store lists containing the ids of created or edited or reviewed postings.

Solution 2: Store a mapping. So for every review (for example) store a new entity that contains userId and posting Id. Retrieve all postings created by a specific user using a query.

Which would you advise?

Solution 2 seems more scalable but more costly.

Saad Attieh
  • 1,396
  • 3
  • 21
  • 42
  • Solution 1 will not work except for limited cases. There is a max list size you will reach and those list cant be searched efficiently – Zig Mandel Jan 14 '15 at 17:16
  • http://stackoverflow.com/questions/13565189/many-to-many-relationships-in-google-app-engine-datastore-ndb?rq=1 it's the same. be careful of the limit of the list – EsseTi Jan 15 '15 at 17:00

0 Answers0