1
votes

According to the documentation, when using ancestor queries the following limitation will be enforced:

Ancestor queries allow you to make strongly consistent queries to the datastore, however entities with the same ancestor are limited to 1 write per second.

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

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

purchase1 = Purchase(ancestor=customer_entity.key)
purchase2 = Purchase(ancestor=customer_entity.key)
purchase3 = Purchase(ancestor=customer_entity.key)

purchase1.put()
purchase2.put()
purchase3.put()

Taking the same example, if I was about to write three purchases at same time, would I get an exception, as its less than a second apart?

1

1 Answers

2
votes

Here you can find two excellent videos about the datastore, strong consistency and entity groups. Datastore Introduction and Datastore Query, Index and Transaction.

About your example. You can use a put_multi() which "counts" for a single entity group write.