GAE Implications of NDB hierarchy and entity groups

Viewed 858

I'm trying to better understand the implications of the deep hierarchy described in the GAE NDB docs

"For example, a revision of a message that "belongs to" an owner, might have a key that looks like"

rev_key = ndb.Key('Account', 'Sandy', 'Message', 'greeting', 'Revision', '2')

I interpret this to mean that if I do Revision(parent=rev_key).put() then I will have an entity group at the Revision=2 level meaning ancestor queries where ancestor=rev_key will have strong consistency and writes where parent=rev_key will be limited to 1/sec.

But what are the implications further up the hierarchy?

For instance, say I have

rev_key_B = ndb.Key('Account', 'Sandy', 'Message', 'greeting', 'Revision', '3')

Is write speed limited to 1/sec at the rev_key_B level or, since they share a parent's parent, i.e. ndb.Key('Account', 'Sandy', 'Message', 'greeting'), is write speed limited even higher up the ancestor path and, ultimately, to the entire entity group all the way up to ndb.Key('Account', 'Sandy')?

Same questions re: strong consistency. Would Revision.query(ancestor=ndb.Key('Account', 'Sandy', 'Message', 'greeting')) have strong consistency?

1 Answers
Related