0
votes

When you perform an ancestor query, it is limited to one write per ancestor per second. Does this apply to different entity kinds or the same kind?

For example, https://cloud.google.com/appengine/docs/python/ndb/queries#ancestor

class Customer(ndb.Model):
    name = ndb.StringProperty()

class Purchase(ndb.Model):
    price = ndb.IntegerProperty()

class Order(ndb.Model):
   shipping = ndb.StringProperty()

purchase1 = Purchase(parent=customer_entity.key)
order1 = Order(parent=customer_entity.key)

Can you write to both purchase and order at the same time?

2

2 Answers

1
votes

Yes, you can write both purchase and order at the same time. Limitations, when writing entities in the datastore, apply in the case you use transactions.

For example, in your snippet you may write both entities using ndb.put_multi().

0
votes

It applies to the whole entity group, regardless of the entity Kind (actually, Datastore doesn't much care about kinds — only keys and entities).

You can operate separately on your order and your purchase, but not with the strong consistency of transactions. If you want strong consistency, then your customer_entity will define the scope of that consistency and the reach of the write rate limit.