Getting around GAE’s 1000-result limit
Posted: August 10th, 2009 | Tags: google app engine, python | No Comments »UPDATE: Version 1.3.1 of the SDK has removed the 1000-result (and added cursors), so there’s no longer any reason to use this technique.
When you consider Google App Engine‘s posted hard cap on returning a maximum of 1000 results per query and their alluded-to workaround, it seems like the GAE engineers are trying to send a message. Combining the two facts there, I interpret it as saying something like this:
We know more about how GAE and BigTable work than you do, and we have a much better idea of what each operation costs. Based on the platform we’re giving you, we don’t think you want to be returning more that many results. But if you’ve thought about it hard and you’re convinced you do want to be doing this, there’s a roundabout way to do it.
I thought about it for a while in the context of a project I’m working on, switched my design around a bit (as I get my head around the differences between BigTable and SQL), and still want to get more than 1000 results. So I took the example linked to above, and implemented it in a generator for ease of use.