Search code examples
pythongoogle-app-enginedatastoreancestor

Ancestors in App Engine data store


I've been developing for Google App Engine for a while. One of the features I've noticed but haven't had an opportunity to use yet is "ancestors" in the data store.

What would be an example of a situation where this is useful?


Solution

  • When you create an entity with a parent, the entities are placed in the same Entity Group. Transactions in App Engine can only work within a single entity group, so if you need transactions, you need entity groups. If you don't need transaction, you don't need entity groups (in particular, to build relationships between entities that don't need transactional capabilities, you should use ReferenceProperties, not parent-child relationships.)