StructuredProperty
s belong to the entity that contains them - so your assumption that
updating a single StructuredProperty
will invalidate the memcache is correct.
LocalStructuredProperty
is the same behavior - the advantage however is that each
property on a LocalStructuredProperty
is obfuscated into a binary storage - the datastore
has no idea about the structure of a LocalStructuredProperty
. (There is probably a deserialization
computational cost attributed to these properties - but that depends a lot on the amount
of data they contain, I imagine.)
To contrast, StructuredProperty
actually makes its child properties available for
Query indexing in most cases - allowing you to perform complicated lookups.
Keep in mind - you should be calling put()
for the containing entity, not for each
StructuredProperty
or LocalStructuredProperty
- so you should be seeing a single RPC
call for updating that parent entity - regardless of the number of repeated properties exist.
I would advise using StructuredProperty
that contain ndb.IntegerProperty(repeated=True)
, rather
than making 'parallel lists' of integers and floats - that adds more complexity to your python
model, and is exactly the behavior that ndb.StructuredProperty
strives to replace.