0

Thinking about using Google Datastore in a project since I will use mostly Google Cloud tools. My worries lie within the official limits stated by Google Cloud Datastore.

Maximum size for an entity: 1,048,572 bytes or roughly 1MB.

From my application's point of view, one entity itself would never reach that size anyway. However, I would use the Google Datastore's concept of Ancestor paths in which you may hierarchically nest entities as children of a parent entity.

Tee problem is, one kind of entities will have dozens of direct children (entities) within it. Therefore, that will most likely reach the 1MB size limit.

My question being... does the size of nested child entities count against the parent entity total size... or not?

Lazhar
  • 1,401
  • 16
  • 37

1 Answers1

2

No, child entities are separate entities so they don't count towards the size of any parent entities.

Child entities are related to parents through their keys, and the datastore backend will do thing differently for child-parent relationships, but that doesn't change the fact that each is its own entity with its own size limit.

new name
  • 15,861
  • 19
  • 68
  • 114
  • Does the no of keys also count towards the size of parent entity? – Ajeet Nov 16 '17 at 13:04
  • Nope, the number of keys doesn't matter either, the parent entity size is in no way related to the number of descendent entities. But be aware of other implications, see https://stackoverflow.com/questions/46411694/is-there-an-entity-group-max-size/46411983#46411983 – Dan Cornilescu Nov 16 '17 at 16:26