I hear ya. Its definitely non-trivial. I will do some research with
the AWS folks to get some insight.
But in my application, it stores millions of records. The browser app
has paging built in, so they
see things like " Page 1/2500 of 1,255,000 results. To achieve that
it uses NextToken and limit
values. This makes the server query fast in most cases since it only
actually returns the page limit
to the browser and the middle tier querying SDB also, only gets a page
at a time.
Obviously, returning a million results from a select doesn't work in
any architecture.
Good question on how that state is maintained though. I suspect it has
to do with the result
calculus in their query engine caching offsets or something. Or the
nexttoken is a ciphered
instruction for skipping to a certain junction in the result set at
query time before returning
values. This way its done in the query engine before putting any
results on the wire..
On Jun 13, 12:51 pm, Rob Tweed <
rob.tw...@gmail.com> wrote:
> Excellent!
>
> NextToken will come eventually, though with node-mdb being a local database,
> IMO you really don't have the concern about using internet bandwidth to
> return large numbers of results. It's also never been clear in any of the
> SDB specs (and answers to my questions in the SDB forums) just how NextToken
> works: ie does SimpleDB retain state for a resultset, and if so, for how
> long? ....or is the query rerun and the NextToken used to seed the start of
> the next set of results.
>
> The first is efficient, but requires a state-management to retain resultsets
> and a garbage collection mechanism to determine when to delete the cached
> results (but apparently this isn't how SimpleDB works).
>
> The second is inefficient but a simple stateless system.
>
> You can see how it might work serially for very simple queries, but for
> Select queries that are the result of the intersection or aggregation of
> several sub-query predicates, it becomes difficult to see how to implement
> NextToken without retaining a resultSet cache.
>
> Anyway, the bottom line is that the NextToken is a non-trivial piece of
> functionality.
>
> Rob
>
> Director, M/Gateway Developments Ltdhttp://
www.mgateway.com