On Wed, Aug 12, 2009 at 5:35 PM, Andy Freeman<ana...@earthlink.net> wrote: > > I just realized that I should have phrased this as a question. > > Is it true that updating a single entity more than once a second is > problematic?
Yes, though this is a 'soft' limit - in practice you may be able to do anything up to 10 updates a second with varying levels of retries. The 1 per second is a guideline for when you should consider alternate approaches. > > How often can one single entity (using a transaction) with a low > likelyhood of contention? See above. > > If the answer depends on the number of indices it's in, what are some > reasonable rules of thumb? > > Thanks, > -andy > > On Aug 10, 6:10 am, Andy Freeman <ana...@earthlink.net> wrote: >> > Finally, do look at the info on sharded counters if you expect >> > individual counters to be updated more than about once a second. >> >> That is fairly disturbing advice as it seems to suggest that updating >> a simple entity more than once a second is problematic. >> >> I would have thought that it would be safe to update a given entity >> 10-15 times/second and maybe even 20x/second. (10x/second is 100ms per >> update, 15 is over 65ms per update, 20 is 50ms per update.) Frankly, >> I'm surprised that 5 times/second is too fast. (5x/second is 200ms per >> update.) >> >> On Aug 10, 5:24 am, "Nick Johnson (Google)" <nick.john...@google.com> >> wrote: >> >> >> >> > On Sun, Aug 9, 2009 at 4:58 PM, Markitecht<markite...@gmail.com> wrote: >> >> > > Thanks Nick, makes complete sense. >> >> > > I'll write it so that for each Interaction, it finds the appropriate >> > > entity, increments the counter and stores it; if looking for the >> > > entity turns nothing up, i make a new one with a counter set to 1. >> >> > > right? >> >> > Right. Just make sure to do it inside a transaction if you need exact >> > counts. And use key naming to avoid the need to do queries. >> >> > Finally, do look at the info on sharded counters if you expect >> > individual counters to be updated more than about once a second. >> >> > -Nick Johnson >> >> > > thanks again for the quick and kind attention. >> >> > > best, >> > > Christopher >> >> > > On Aug 7, 6:02 am, "Nick Johnson (Google)" <nick.john...@google.com> >> > > wrote: >> > >> Hi Markitecht, >> >> > >> It sounds like your best option is to have a single Interaction entity >> > >> for each unique string. You can use the key name to ensure uniqueness. >> > >> Then, to record a new interaction, in a transaction fetch the existing >> > >> one (if any), increment the count, and store it. >> >> > >> If you expect some interactions to be very popular (more than a few >> > >> updates a second), you should probably look into sharded counters. >> >> > >> -Nick Johnson >> >> > >> On Wed, Aug 5, 2009 at 7:15 PM, Markitecht<markite...@gmail.com> wrote: >> >> > >> > I am writing a dirt-simple tracking API. >> >> > >> > For the sake of explanation, i will over-simplify my question even >> > >> > further. >> >> > >> > I have an endpoint that accepts one item of string metadata, and saves >> > >> > a new instance of an Interaction object. >> >> > >> > (the interaction object also saves the user and the date created) >> >> > >> > How do i query Interaction to return the most popular >> > >> > 'interactions' (using those string metadata values), with a count for >> > >> > each? >> >> > >> > This seems *so* simple, but i just can't figure out how to do it on >> > >> > AE. >> >> > >> > Thanks, >> > >> > Christopher >> >> > >> -- >> > >> Nick Johnson, Developer Programs Engineer, App Engine >> >> > -- >> > Nick Johnson, Developer Programs Engineer, App Engine- Hide quoted text - >> >> > - Show quoted text -- Hide quoted text - >> >> - Show quoted text - > > > -- Nick Johnson, Developer Programs Engineer, App Engine --~--~---------~--~----~------------~-------~--~----~ 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 google-appengine+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~----------~----~----~----~------~----~------~--~---