On Thu, Oct 27, 2011 at 2:16 PM, Jose Montes de Oca < [email protected]> wrote:
> > On Thursday, October 27, 2011 1:06:16 PM UTC-7, Jeff Schnitzer wrote: >> >> I'm going to be the dissenting here. You should consider #1 if you know >> that you're always going to have on the order of 100 items. You can easily >> cache this value in memcache. > > > IMO this would depend on the size of the items, fetching 100 items and > then traversing then to do a simple sum could be a great overhead on read > time that could be avoid by doing this on write time. (This is App Engine > strategy for queries) > Sure, it depends on entity size... but the "typical" entity not so large that this is an issue, and the OP's Score entity sounds tiny. If he can cache for any length of time, computation is a non-issue. It also depends on change rate. If the data changes frequently, it will likely be significantly cheaper and easier to calculate it ad-hoc rather than pre-calculating. Especially if he doesn't need instantaneously accurate results. > If you do an ancestor query you will get consistent data. > ...but only if you have everything in one entity group. Everything is a tradeoff. Jeff -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.
