Summary
In this chapter, we started with the need for data modeling and examined how to model data using the ndb's Model class. Then we dived into how it is stored internally, with all the properties serialized into a single column. Next we examined in detail how datastore constructs unique row keys for an entity by using the application ID, the current namespace, the Kind (the model's class name), and a unique identifier. We also studied how the identifier can be either a string or an integer. In the case it is an integer, we learned that datastore generates numeric IDs, and we can allocate our own range of IDs as well if we want to.
Next we examined the ndb.Key class and how it allows us to weld keys together to achieve some interesting effects. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access