Agreed on all points.  Some additional thoughts that I have had...

The locality of Entity Group data provides "strong consistency" and
potentially some speedup on ancestor queries (pending benchmarks). The
"strong consistency" enables these Entity Groups to operate in
"transactions", though only to the point of about 1 write/sec.

So for me, if I am trying to figure out if two kinds of entities should
belong in the same group, it merely comes down to whether or not ALL these
statements are true:

1) I need to perform an ancestor query such that the data retrieved is
strongly consistent.  For example, give me all the account balances in the
bank at a point in time.
2) I need to perform a transaction that affects two or more entities.  For
example, transferring money from member A to member B.
3) My data write requirements do not exceed 1 write/sec in a transaction

I say ALL because if the first point is not needed, XG transactions would
still allow for transactions of the entities if they weren't put in the
same group (assuming you stay under the limit of 25 kinds of entities).



On Thu, Oct 6, 2016 at 10:49 AM, 'Alex Martelli' via Google App Engine <
[email protected]> wrote:

> On Tue, Oct 4, 2016 at 5:23 PM, Paul Mazzuca <[email protected]>
> wrote:
>
>> Is there any reason to use an Entity Group in Google Datastore other than
>> for enabling transactions?
>>
>
> Strong consistency: ancestor queries are strongly consistent. That's a key
> semantic difference compared with the eventual consistency of most queries
> (though, of course, you do pay for it in othe ways).
>
> And yes, you MAY get some performance benefits due to locality under very
> specific circumstances -- see https://cloud.google.com/d
> atastore/docs/articles/balancing-strong-and-eventual-consist
> ency-with-google-cloud-datastore/#h.3loc7ynqbw6i for MUCH more.
>
>
>
>>
>> For example, does having entities in the same entity group speed up
>> queries?  The situation that I run into often is whether to have X be a
>> parent to Y or have X be a property of Y.   Both cases allow for Y to be
>> queried given X, but when transactions aren't needed perhaps the entity
>> group is not necessary.  I guess another way of stating the question is
>> whether or not ancestor queries provide speed up over property based
>> queries without ancestors?
>>
>
> Not in the general case, but, in specific ones (since, per the URL I
> quoted, "entities are sorted and stored by the lexicographical order of the
> keys"), it sure might help.
>
> Me, in this case like in many others, I'm partial to benchmarking -- make
> a toy app closely simulating your specific use case, implemented both ways,
> run a large number of equivalent queries in either way, get the precise
> delay numbers and ponder their histograms. I'll take real data over
> theoretical considerations any day of the week:-).
>
> Alex
>
>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Google App Engine" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To post to this group, send email to [email protected].
>> Visit this group at https://groups.google.com/group/google-appengine.
>> To view this discussion on the web visit https://groups.google.com/d/ms
>> gid/google-appengine/846d1d10-af2c-4c9a-80eb-bf29708017da%40
>> googlegroups.com
>> <https://groups.google.com/d/msgid/google-appengine/846d1d10-af2c-4c9a-80eb-bf29708017da%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Google App Engine" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/google-appengine/tTn_BS84zFE/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/google-appengine.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/google-appengine/CAE46Be-HGX-rSxOupZpgT2XCCF2u8eUGPk3Abs1ea
> 3WzAd2Bzw%40mail.gmail.com
> <https://groups.google.com/d/msgid/google-appengine/CAE46Be-HGX-rSxOupZpgT2XCCF2u8eUGPk3Abs1ea3WzAd2Bzw%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/CAJpXATS2ACS2-Y1sDzXK_M6cbuEFVvRyW%3DTN2zx3p8rx_NabZA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to