On Wed, Feb 15, 2012 at 8:14 AM, stephenp <[email protected]> wrote:

>
> The "without the false positives or false negatives" comment led me to
> believe that as long as I did my query within a transaction I would see
> results that were previously added within a different transaction (except
> in the case of an unapplied write - which requires manual admin
> intervention). For example, in my app I need to do some post-processing
> after a new item is added. I do this by enqueuing a transactional task.
> That task runs a query that should return the item previously added. Is
> there no way to ensure my query will include the item - e.g. avoid the
> false negative. If not, any suggestions on how to implement this sort of
> post processing once the item's index do get updated? My post processing
> queries lots of different data and stitches together a bunch of statistics
> and statistical summaries.
>

Queries inside of transactions must be ancestor queries.  GAE won't let you
run a global query in a transaction.

I'm not sure, but it sounds like you're confusing "enlisting the add-task
operation in your current transaction" with "run a task within a
transaction".  When your task runs, there is no transaction unless you
create one.

In answer to your general question, which I'll roughly summarize as "how do
you model and query data to minimize the impact of eventuality on your
business?", the answer is "very carefully".  Pick and choose your entity
group structures carefully.  Allow for eventuality when you can.  In the
handful of places where you need exact numbers, use shareded counters and
memcache CAS operations for performance.

But usually when you're talking about statistics you aren't worried about
realtime operations, so why do you care?  Just let eventuality rule.
 Statistics are old milliseconds after you generate them anyways; does it
matter if the stats are tens of seconds of eventually consistent?
 Obviously in some situations it can be, but it's certainly worth
re-examining your real requirements.  Anything "realtime" is 100X more
effort no matter what platform you're on.

Jeff

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