I will implement the counting of the artists as presented in
http://www.youtube.com/watch?v=ZwNUKpZmODc#t28m20s
With this solution, writing counts is batched in memcache. Counts are
written to datastore on every xth count. Now, the query for getting
the top10 list from datastore stays pretty straightforward. I
understand that counts may get lost from memcache under some
circumstances (but memcache seems very stable) and that the top10
never reflects real-time counts (counts for artists are still in
memcache). Thanks for your reactions.


On 12 okt, 23:28, "Jason (Google)" <apija...@google.com> wrote:
> It sounds like each individual artist has a sharded counter associated with
> it in your current design. You can change this to just shard a single entity
> type, say Artists, which contains a Map keyed on artist name. Then, when you
> want to rank the top 10, just pull all the Artists shards, sum up the counts
> and sort by top count. How many artists are you working with? Will this work
> for your use case?
>
> You can go with Jeffrey's solution also since the Top10 entity will only
> have to be updated when the Top10 changes. If this isn't likely to happen
> more than once per second, then a single Top10 entity will work.
>
> - Jason
>
>
>
> On Sun, Oct 11, 2009 at 10:11 PM, Peter Hulsen <hul...@gmail.com> wrote:
>
> > I suppose the top 10 entity becomes the bottleneck, right? Especially
> > when you also want to keep track of counts in the top 10 entity. Or do
> > you have a way to make this scale? Thanks.
>
> > On 10 okt, 19:15, Jeffrey Goetsch <jeffg....@gmail.com> wrote:
> > > You should do a Top 10 entity.  This hold the top ten artists.  Every
> > time
> > > you update an artist count, compare that count to the Top 10 entity.  If
> > the
> > > artist should be in the Top10, update otherwise ignore.
> > > --Jeff
>
> > > On Thu, Oct 8, 2009 at 1:27 PM, Peter Hulsen <hul...@gmail.com> wrote:
>
> > > > I use shared counters to keep count of things, e.g., how many times an
> > > > artist page is visited. Now I like to create a top 10 list of most
> > > > popular / most visited
> > > > artists. What is the best way to go forward? It is not possible to get
> > > > all shared counters of all artists (too many entities) and then do the
> > > > construction of the list in Java. Please some advise needed. Thanks.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to