aws / aws-sdk-js-v3

Modularized AWS SDK for JavaScript.
Apache License 2.0
3.03k stars 568 forks source link

Incomplete DAX support #5640

Closed khosalan closed 1 month ago

khosalan commented 8 months ago

Describe the issue

@aws-sdk/client-dax - can perform only create/delete cluster operations. Cannot perform dataplane operations like get/ query with this and its been over 3 years since V3 was released. Very disappointing. Have migrated from V2 to V3 and stuck with this.

Links

https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/dax/

RanVaknin commented 8 months ago

Hi @khosalan ,

Both in v2 and v3 DAX client is a control plane client. You can use the Dyanmodb client to make data plane operations. All you need to do is setup the Dynamodb client to make requests to the DAX endpoint of your cluster.

Thanks, Ran~

khosalan commented 8 months ago

Hi @RanVaknin ,

Could you please help me to understand how to setup DynamoDB client make request to DAX endpoint in v3?

For v2 had an additional package "amazon-dax-client" in which able to configure DAX endpoint like below,

const AmazonDaxClient = require('amazon-dax-client');
const dax = new AmazonDaxClient({endpoints: [endpoint], region: region});
const doc = new AWS.DynamoDB.DocumentClient({service: dax});

But for v3 couldn't find anything similar to that.

Thanks

RanVaknin commented 8 months ago

Hi @khosalan,

The amazon-dax-client is an abstraction over the dynamodb client. This specific package is not a part of the AWS SDK, and was not updated to support v3.

Can you try the following:

const client = new DynamoDBClient({ 
  region: "your-region",
  endpoint: "your-cluster-URL",
});

// rest of your code.
khosalan commented 8 months ago

Hi @khosalan,

The amazon-dax-client is an abstraction over the dynamodb client. This specific package is not a part of the AWS SDK, and was not updated to support v3.

Can you try the following:

const client = new DynamoDBClient({ 
  region: "your-region",
  endpoint: "your-cluster-URL",
});

// rest of your code.

This doesn't work

pdguru81 commented 5 months ago

Hi @khosalan - did you find a workaround for this problem?

RanVaknin commented 1 month ago

Hi there,

i just want to provide some update on this.

After much investigating and trying to get this to work, this is not possible. DAX uses its own CBOR protocol that does not work directly with the SDK.

We have raised a request to ask DAX directly to update their SDK to work with JS SDK v3.

Related: https://github.com/aws/aws-sdk-js-v3/issues/4263

Thanks, Ran~

github-actions[bot] commented 2 weeks ago

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.