sayanroyc / Spartan_Server

0 stars 0 forks source link

Cleaning Reviews/Events Database #27

Closed sayanroyc closed 8 years ago

sayanroyc commented 8 years ago

Instead of having a separate databases for reviews and events, use the structured property to include them within their respective user/item class.

https://cloud.google.com/appengine/docs/python/ndb/properties#structured

nickgarfield commented 8 years ago

Is Structured Propeety better than Key Property for our setup? This post shows the decision is kind of a cost/features trade off

http://stackoverflow.com/questions/11748695/most-efficient-one-to-many-relationships-in-google-app-engine-datastore

nickgarfield commented 8 years ago

Structured Property would be cheaper (less read/write operations) but do we need all of the reviews every time we show an item/user? Also could the number of comments push the size of those item/user objects over 1MB?

nickgarfield commented 8 years ago

Maybe we should use Structured Property and hold only the latest 50 text reviews or so? The limit could be higher/lower depending on how many comments we find users are actually looking at

nickgarfield commented 8 years ago

Another option could be to create a GroupOfReviews object that holds like max 5-7 reviews. Then each item/user has a KeyProperty thar points to GroupOfReviews objects. On the client side, we load the latest GroupOfReviews, and present a "See More" button that loads the next GroupOfReviews object

sayanroyc commented 8 years ago

I really like the idea of having the latest x amount of reviews as a structured property and load the rest if the user clicks see more. By the way, ReferenceProperty in db == KeyProperty in ndb