Closed sayanroyc closed 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
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?
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
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
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
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