Get started for free

The following is an excerpt from "The Infinite Machine"


In the last article I showed how you can use recursive sharding (Sharding Inception!) and the taskutil @task to visit Datastore objects for a given query in O(log n) time.

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"

THIS EBOOK MIGHT INTEREST YOU

LX-Designer-Book

The LX Designer’s Handbook

A comprehensive guide to the changing world of learning design

Download ebook for free

Comments

Get the latest updates by email