I've not personally tried it before, but a possible alternative to shard 
counters is increment logs.

Basically, you store the count with your entity, and each time you need to 
increment the count you will instead store an new increment entry that 
references the entity that needs to be incremented.
Whenever you need to get the live count of an your entity, you get the count 
from the entity then add the number of increments found.
You will of course need a cronjob that will flush the increments and update 
the counts to the entities, with a suitable frequency.

Now you can obtain the top 10 products by doing a simple sorted query with 
limits, based on the count since the last flush. If you need accurate 
results, you can perform a flush right before the query.

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-appengine-java/-/bIja-rmMgHMJ.
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