Code Monkey home page Code Monkey logo

Comments (6)

philwills avatar philwills commented on May 24, 2024

It returns a stream, which lazily pulls in page by page, so if you for instance .take(100) on it, then it will only pull back the number of pages necessary to support that.

It will always attempt to pull back a full page of results, so you might pull back a bit more data than is strictly necessary, but there shouldn't be additional requests.

from scanamo.

kraus-as24 avatar kraus-as24 commented on May 24, 2024

Thanks. I actually need only the first result (or the last one using a descending query) with ordering given by a range key. But as DynamoDB is supporting defining a limit on queries is it planned to add this feature? And what do you think is the difference concerning performance. Thanks.

from scanamo.

philwills avatar philwills commented on May 24, 2024

It's not the near the top of my list at the moment, as my main focus with the library is to try and allow things to be done in a simple, safe way and this is currently achievable, if not optimal. Any suggestions or PRs on how it could be supported without major changes to the API would be welcome.

In terms of performance, it's very difficult to know in the abstract. I'd be a bit surprised if it was a bottleneck, but without benchmarking the particular app I wouldn't like to pretend certainty.

from scanamo.

adamnfish avatar adamnfish commented on May 24, 2024

One concern is that in an app with a single-read-heavy workload, you'd have to over-provision your tables by pagesize. I wonder if exposing a way of setting the page size on the underlying DynamoDB req would give the developer the chance to optimise requests for the expected use-case?

I'll have a look through the code, see if I can work out a nice way to do it.

from scanamo.

philwills avatar philwills commented on May 24, 2024

That's a good point about capacity consumption. It's now definitely on the list.

from scanamo.

philwills avatar philwills commented on May 24, 2024

This is now available in 0.5.0

from scanamo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.