GAE ndb design, performance and use of repeated properties

app-engine-ndb, google-app-engine, google-cloud-datastore, python-2.7

Solution

Do not use repeated properties if you have more than 100-1000 values. (1000 is probably already pushing it.) They weren't designed for such use.

Problem

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?

Original source