Skip to content
This repository has been archived by the owner on Aug 27, 2023. It is now read-only.

Does flywheel automatically deals with the 1MB limit per API call in the queries? #20

Open
rcalsaverini opened this issue Oct 1, 2014 · 4 comments

Comments

@rcalsaverini
Copy link

According to this page, the queries on dynamoDB are limited to 1MB per result set and any aditional results can be retrieved by doing extra API calls using the LastEvaluatedKey value that is returned in the previous call.

Does flywheel deals with this "pagination" automatically?

Thanks.

@rcalsaverini rcalsaverini changed the title Does flywheel automactically deals with the 1MB limit per API call in the queries? Does flywheel automatically deals with the 1MB limit per API call in the queries? Oct 1, 2014
@stevearc
Copy link
Owner

stevearc commented Oct 2, 2014

Flywheel automatically handles pagination. This has been confirmed with unit tests when the number of results exceeds the limit, but the 1MB data limit has not been explicitly tested.

@Govinda-Fichtner
Copy link

@stevearc What does that exactly mean? If I have more data than 1 MB for a query Flywheel will fetch it automatically under the hood with multiple requests?

And from the perspective of using the all() method - does this mean that I get a list with all results including those above 1MB back?

I feel that the documentation about [Queries](http://flywheel.readthedocs.io/en/latest/topics/queries.html} should describe this case and the behaviour in detail.

@stevearc
Copy link
Owner

stevearc commented Aug 2, 2016

Short answer: yes

Under the hood you're going to get back a ResultSet when you perform a query. This is an iterator that will perform successive queries for you until there are no more results. It completely abstracts away the pagination so you should never have to worry about it.

all() will iterate to the end and give you a list of models that were built from the results. Compare with gen(), which returns a generator that will perform the successive fetches on-demand.

@Govinda-Fichtner
Copy link

@stevearc Thanks a lot for the clarification!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants