Description
Use case
The new idempotency utility uses conditional writes against DynamoDB for its locking mechanism.
When the conditional write fails, the record is considered locked and the request is already processed. In that case, a query is issued against DynamoDB to fetch the cached result and return it.
This means for this scenario that customers must wait and pay for both a write and read, even though the write fails.
On June 30, 2023, DynamoDB announced the ability for a failed conditional write to return a copy of the existing record. This would allow the package to skip performing the query, improving performance and lowering cost.
Solution/User Experience
In the idempotency utility, use the new DynamoDB conditional write behavior to return the current state of the item in the same conditional write operation. Remove the follow-up query.
Alternative solutions
No response
Acknowledgment
- This feature request meets Powertools for AWS Lambda (Python) Tenets
- Should this be considered in other Powertools for AWS Lambda languages? i.e. Java, TypeScript, and .NET
Metadata
Metadata
Assignees
Labels
Type
Projects
Status