Ok, but this model still involves having the products in the same entity group as the sharded ratings, right? That isn't what I read from "use shards to track the ratings (but without using transactions)". I can easily see how you don't need a transaction to sum the shards into the total, but you definitely need a transaction to add the new rating and add its weight to the shard. -J
-------------------------------------------------- From: "yejun" <[EMAIL PROTECTED]> Sent: Tuesday, November 04, 2008 9:11 AM To: "Google App Engine" <google-appengine@googlegroups.com> Subject: [google-appengine] Re: more complicated counters/ratings (sorting?) > > You keep total rating values and number of users rated both in two > shard counters which are not belong to your product entity group. Then > update your average rating for your product's entity group > periodically like once every 100 request or 1000 request depends on > your need. So the concurrency level is only determined by the number > of shards not by number of users or products. > > Even though the transfer data from shard counter to your entity group > is non-transactional, but the updating of raw records are > transactional, the data will be corrected next time when you update > average rate. Updating will only takes the time of a dozen of > datastore read and 1 put. > > > On Nov 4, 11:40 am, "Jay Freeman \(saurik\)" <[EMAIL PROTECTED]> > wrote: >> If I don't use transactions (with the ratings in the same entity groups >> as >> the shards they are being served by) then I can't be guaranteed I don't >> accidentally drop or double count ratings in the case of errors. :( Is >> the >> idea that you are recommending I just say "oh well, its a drop in the >> bucket"? -J >> >> -------------------------------------------------- >> From: "Alexander Kojevnikov" <[EMAIL PROTECTED]> >> Sent: Tuesday, November 04, 2008 1:12 AM >> To: "Google App Engine" <google-appengine@googlegroups.com> >> Subject: [google-appengine] Re: more complicated counters/ratings >> (sorting?) >> >> ...> I would use shards to track the ratings (but without using >> > transactions) and from time to time re-calculate the average from the >> > shards and keep it with the product. This would allow indexing by the >> > average rating, without many sacrifices. >> >> ... > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to google-appengine@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---