In the last article I talked in depth about ndb Keys, entity groups, ancestor queries, and all that; so much that maybe we all forgot why? Why we care about ndb Keys is that they are always present as the handle to an ndb object, and they are ordinal (albeit in an incredibly obtuse fashion). We can exploit this ordinality to allow us to recursively shard over ndb entities, and so access them potentially in O(log n) time, rather than O(n).
Here’s the first part of this article:
Ok, this is a good goal in theory. But how do we manage it in practice?
Let’s grab our heavy gloves and go rummaging in Google’s dumpster, see if we can find some perfectly good code for this...