Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can we use with aws-sdk v3? #58

Open
ghost opened this issue Jun 13, 2021 · 8 comments
Open

Can we use with aws-sdk v3? #58

ghost opened this issue Jun 13, 2021 · 8 comments

Comments

@ghost
Copy link

ghost commented Jun 13, 2021

Hi.
Can this library be used with aws-sdk v3?

@csr
Copy link

csr commented Jun 14, 2021

It cannot. Since I'm using this library in a Lambda function and want to minimize space by importing only the dynamodb bits, does anyone know how to avoid importing the entire SDK with const AWS = require('aws-sdk')? AWS SDK v3 adds support for a modular architecture, but this library isn't compatible with it yet.

@ghost
Copy link
Author

ghost commented Jun 15, 2021

@csr I thought so. I like the API for v3, and personally use it, but I don’t think using v3 will decrease the container size, and maybe will increase it, since aws-sdk v2 is and always present in the container that a lambda function runs.
Not sure, if not importing aws-sdk will have benefits.

@csr
Copy link

csr commented Jun 16, 2021

@omer-to v3 will decrease the container size if you only import a subset of the AWS SDK in your package.json, thanks to the new SDK modular architecture. For example you can just npm install @aws-sdk/dynamodb and the Lambda function will perform better that way especially with cold starts. See here.

@ghost
Copy link
Author

ghost commented Jun 16, 2021

@csr Nope, the container size will not decrease, just the package size will decrease.
The docker container that is created for a Lambda function to run already includes globally installed aws-sdk whether you import it or not.
That’s why you can deploy your Lambda without aws-sdk package, and you will still be able to import it and use it, because the container already has it.

@nch3ng
Copy link

nch3ng commented Jun 18, 2021

It's not hard to add v3, but it's hard to do backward compatible in one package, I ever tried to add v3, but I think separate package would be ideal. I ever tried to add v3 for testing purpose.

@renet
Copy link

renet commented Oct 3, 2021

I refactored the library to use the AWS SDK v3 and released it as an npm package named dynamodb-geo-v3 here. Feel free to try everything out & open an issue in my repo, if something's not workin as expected. But please be aware that I did not maintain backward compatibility.

@alex-arzaghi
Copy link

here

@renet if I understand correctly, you mentioned dynamodb-geo-v3 is supposed to use AWS SDK v3 but from what I see it still uses the old APIs. Did I misunderstand or am I missing something?

@renet
Copy link

renet commented Oct 29, 2023

@alex-arzaghi This commit shows the refactoring. It's in a different repository, maybe you got that wrong. If you have any more issues with it, please report them there.

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

No branches or pull requests

4 participants