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.

When you get into thousands of items you start to see the point at which
it's not practical to do on-the-fly sums, even just to store the result in
memcache.  But less than thousands, might as well just calculate the sum.

Pre-aggregating the sum is not necessarily trivial.  If the sum changes more
than once per second you need to shard the sum.  Once you get to 100 shards,
you've created a system that doesn't perform any better and is a hell of a
lot more complicated.

One thing to watch out for is eventuality - if your sum needs to be
instantaneously correct, a simple query (on the HRD) may provide lagged
data.  On the other hand, if you are fetching your articles by key (and have
STRONG consistency configured), you're ok.

Jeff

On Thu, Oct 27, 2011 at 12:49 PM, Jose Montes de Oca <
[email protected]> wrote:

> Hi Mos,
>
> You should design your data models as a non relational database, where
> having redundancy its just fine.
>
> Plain and simple:
>
> 1/ will not scale, Not suitable for App Engine non relational database
> (Datastore)
>
> 2/ Right Approach, just need to be careful on what voscausa said.
>
> Hope this helps!
>
> Jose Montes de Oca
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/google-appengine/-/sUbapsIqigAJ.
>
> 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.
>

-- 
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.

Reply via email to