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

How do you use DAX with the DynamoDB v3 client? #3687

Closed
dzou opened this issue Jun 14, 2022 · 4 comments
Closed

How do you use DAX with the DynamoDB v3 client? #3687

dzou opened this issue Jun 14, 2022 · 4 comments
Assignees
Labels
documentation This is a problem with documentation.

Comments

@dzou
Copy link

dzou commented Jun 14, 2022

Describe the issue

Are there any instructions how to use DAX with the aws-sdk v3 Dynamo client? I could only find examples of how to do it with the v2 client, but I want to use the v3 client.

For context, we already are using v3 in many places; would be disappointing to have to migrate to v2 to use DAX.

Links

https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DAX.client.run-application-nodejs.03-getitem-test.html

@dzou dzou added documentation This is a problem with documentation. needs-triage This issue or PR still needs to be triaged. labels Jun 14, 2022
@ajredniwja ajredniwja self-assigned this Jun 16, 2022
@ajredniwja
Copy link
Contributor

Hi @dzou thanks for opening this issue, you can use @aws-sdk/client-dax. https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-dax/globals.html

Is that what you were looking for?

@ajredniwja ajredniwja added response-requested Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days. and removed needs-triage This issue or PR still needs to be triaged. labels Jun 16, 2022
@dzou
Copy link
Author

dzou commented Jun 16, 2022

@ajredniwja -- No, @aws-sdk/client-dax is different. That is a much lower-level client, which only appears to let you create/delete clusters. But we want to do something where the Dynamo client will hit DAX first to check cache, and then fallback to Dynamo if it's not there.

See this example in the AWS documentation: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DAX.client.run-application-nodejs.03-getitem-test.html

var ddbClient = new AWS.DynamoDB.DocumentClient()
var daxClient = null;

if (process.argv.length > 2) {
    var dax = new AmazonDaxClient({endpoints: [process.argv[2]], region: region})
    daxClient = new AWS.DynamoDB.DocumentClient({service: dax });
}

The amazon-dax-client automatically lets you hit DAX first, then hit Dynamo if missing.

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days. label Jun 17, 2022
@ajredniwja
Copy link
Contributor

@dzou my bad, unfortunately it is not supported currently. There is an internal feature request for the DAX team.
See aws/aws-sdk#232

I'll close this issue in favor of the existing issue and try to get an update on it.
Let me know if you have any other questions.

@github-actions
Copy link

github-actions bot commented Jul 2, 2022

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation This is a problem with documentation.
Projects
None yet
Development

No branches or pull requests

2 participants