The following is an excerpt from "The Infinite Machine"
But I left out an important detail. To use the algorithm I presented, I required a random integer to be assigned to each Datastore entity. That’s a fine approach, but wouldn’t it be better to not require something like that?
So for the next article I thought I’d quickly explain ndb keys, then kick on with code that uses the space of keys as the keyspace and happily shards any existing ndb objects.
And then I got stuck for 3 weeks.
I figured out that I was stuck because this explain-ndb-keys thing is no simple task. Judging from all the documentation I’ve seen so far, they are utterly inexplicable. But to go anywhere interesting we need to know exactly how they work. So, let’s try...
Emlyn O'Regan is a Co-Founder and CTO of xapiapps, and the author of "The Infinite Machine"