dynamodb-toolbox icon indicating copy to clipboard operation
dynamodb-toolbox copied to clipboard

Migrate to aws-sdk-js-v3 document client

Open deniszatsepin opened this issue 3 years ago • 8 comments

Migrating from aws-sdk-js-v2 to aws-sdk-js-v3. (https://github.com/jeremydaly/dynamodb-toolbox/issues/155) It uses DynamoDB Document Client v3.

deniszatsepin avatar Jun 03 '21 16:06 deniszatsepin

Will this be merged anytime soon?

kunalshah avatar Sep 12 '21 18:09 kunalshah

It's been months since the PR's been created. I don't think it's getting merged anytime soon. :(

johnbiiibs avatar Jan 04 '22 12:01 johnbiiibs

Waiting for this one as well..

BabyDino avatar Jan 31 '22 12:01 BabyDino

Is there any help needed with this work?

pupeno avatar Feb 13 '22 09:02 pupeno

Let's get this one merged v3 drastically reduces bundle size for serverless apps on lambda 🙌

glcheetham avatar Mar 30 '22 18:03 glcheetham

@glcheetham technically you don't need to bundle v2 in your code since it is included in lambda function environment by default 🤷‍♂️

ptejada avatar Apr 09 '22 02:04 ptejada

@glcheetham technically you don't need to bundle v2 in your code since it is included in lambda function environment by default 🤷‍♂️

True, but worth knowing that it's an 'old' (6 months since release at time of writing - v2.1001.0) version, so make sure you peg your code to the same version to avoid any unexpected issues.

darbio avatar Apr 09 '22 02:04 darbio

This merge has been on hold because of the work on v0.4. This is now a high priority item, but will need a major refactor. Working with other collaborators to get this compatible with v0.4.x.

jeremydaly avatar Jul 05 '22 19:07 jeremydaly

@jeremydaly when is the timeline to get this bad boy in? Do you foresee it being compatible with the current dynamo tool box API or will it introduce breaking changes.

Please note that DAX is not supported by aws s3 - so ideally dynamo toolbox should baked in the ability to switch easily between v2 and v3

6ewis avatar Oct 10 '22 05:10 6ewis

Lambdas Node.js 18 runtime ships with sdk v3, would be nice if this would be merged soon

https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html

NimmLor avatar Nov 18 '22 17:11 NimmLor

Lambdas Node.js 18 runtime ships with sdk v3, would be nice if this would be merged soon

https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html

At the moment I'm focusing on getting all the features/bug fixes in the issues section done, mostly because v3 is not backwards compatible, as far as I know.

Let me know if I'm wrong, would love to add support for v3

naorpeled avatar Nov 18 '22 19:11 naorpeled

V3 has some backwards compatibility interface but is not recommended to use it because it does not take advantage of the modularity of the new API

ptejada avatar Nov 18 '22 19:11 ptejada

dynamodb-onetable does support both V2 and V3 via a small abstraction layer. Maybe this idea could be useful here as well.

shishkin avatar Nov 20 '22 08:11 shishkin

@shishkin Thanks for calling this out!

Anyone else looking for a good DynamoDB library with Deno, I can verify that dynamodb-onetable is working great with Deno 1.28 by way of these three imports and following the dynamodb-onetable documentation for setting up the connection, table, model, etc.

... in import_map.json
    "@aws-sdk/client-dynamodb": "https://esm.sh/@aws-sdk/[email protected]",
    "dynamodb-onetable": "https://esm.sh/[email protected]",
    "dynamodb-onetable/Dynamo": "https://esm.sh/[email protected]/Dynamo"
...

Looks like a great abstraction, hopefully dynamodb-toolbox will benefit from it too!

revgum avatar Nov 20 '22 16:11 revgum

dynamodb-onetable does support both V2 and V3 via a small abstraction layer. Maybe this idea could be useful here as well.

Great idea :) If anyone wants to open a PR for this let me know. If not, I'll try to implement it soon but a bit busy in the next few days 😢

@shishkin Thanks for calling this out!

Anyone else looking for a good DynamoDB library with Deno, I can verify that dynamodb-onetable is working great with Deno 1.28 by way of these three imports and following the dynamodb-onetable documentation for setting up the connection, table, model, etc.

... in import_map.json
    "@aws-sdk/client-dynamodb": "https://esm.sh/@aws-sdk/[email protected]",
    "dynamodb-onetable": "https://esm.sh/[email protected]",
    "dynamodb-onetable/Dynamo": "https://esm.sh/[email protected]/Dynamo"
...

Looks like a great abstraction, hopefully dynamodb-toolbox will benefit from it too!

Adding support for Deno is a great idea and should be fairly easy to implement afaik, will add that as a card on our milestones board.

naorpeled avatar Nov 20 '22 16:11 naorpeled

Really keen to finally see this PR get over the line. Is there anything you need help with?

alexedwardjones avatar Dec 20 '22 17:12 alexedwardjones

Really keen to finally see this PR get over the line. Is there anything you need help with?

I'm not sure whether to push it before closing the rest of the open issues or not. This change would prevent people who are using the previous versions from enjoying the benefits of bugfixes/features that will be done based on the current implementations.

V1, will include SDK v3 support out of the box, along with a big re-write of most of the current code.

At the same time, we could make a wrapper above the SDK v3 client, like mentioned in one of the above comments. If anyone wants to create a PR for this, go for it. Unfortunately, I don't think I'll be able to work on this and test it thoroughly before mid-ish January.

naorpeled avatar Dec 20 '22 17:12 naorpeled

What is the timeframe for v1? That might answer the question..

If it's less than 6 months, I'd say we wait. If it's more then we build a wrapper as discussed.

darbio avatar Dec 20 '22 19:12 darbio

What is the timeframe for v1? That might answer the question..

If it's less than 6 months, I'd say we wait. If it's more then we build a wrapper as discussed.

There's no set date at the moment, but I'm hoping and feel it will be in the 6 months zone and not more. (this is purely my estimation)

naorpeled avatar Dec 20 '22 19:12 naorpeled

Hi, any news with this PR ?

mkovel avatar Mar 09 '23 13:03 mkovel

Hey everyone, due to AWS's decision to make AWS SDK v2 go into maintenance mode soon, I'll be going over this PR asap and get this merged OR migrate the latest codebase to use V3. Not sure if later today but will try my best to do it this week.

naorpeled avatar Mar 09 '23 18:03 naorpeled

@naorpeled How close is this next update out of interest?

jvgeee avatar Mar 21 '23 05:03 jvgeee

@naorpeled How close is this next update out of interest?

I hope we'll be able to release it sometime during this weekend or next week 🙏

naorpeled avatar Mar 27 '23 22:03 naorpeled

Hey everyone, this was released in v0.8 😎 !

naorpeled avatar Apr 08 '23 15:04 naorpeled