Say I have a picture gallery and a picture could potentially have 100k+ fans. Which ndb design is more efficient?
class picture(ndb.model):
fanIds = ndb.StringProperty(repeated=True)
... [other picture properties]
or
class picture(ndb.model):
... [other picture properties]
class fan(ndb.model):
pictureId = StringProperty()
fanId = StringProperty()
Is there any limit on the number of items you can add to an ndb repeated property and is there any performance hit with storing a large amount of items in a repeated property? If it is less efficient to use repeated properties, what is their intended use?
CamelCase
and property nameslower_case_underscore
.. – CwmbranpictureId
use thendb.KeyProperty(kind=picture)
as you have it in the current model.. andfanId = ndb.KeyProperty(kind=fan, repeated=True)
instead ofStringProperty
for better handling of the entities. – Cwmbran