-
Notifications
You must be signed in to change notification settings - Fork 401
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
Feature request: Leverage new DynamoDB Failed Conditional Writes behavior #3327
Comments
Thanks for opening your first issue here! We'll come back to you as soon as we can. |
Great idea, Dan! We totally missed it. We’re all hands on deck for reinvent
but if this is something you’d like to contribute we’d be more than happy
to answer any question you have.
Setting expectation
The hardest part until we rewrite is tests. Idempotency wasn’t designed to
split the storage provider from day 1, and we’re fixing that on a Redis PR…
but we’re here to help.
We created our own framework for E2E test to make things easier at scale;
should be easy enough to add a new E2E test in Idempotency — it supports
step through debugging in PyCharm too.
Documented here
https://docs.powertools.aws.dev/lambda/python/latest/maintainers/#e2e-framework
…On Mon, 13 Nov 2023 at 17:04, boring-cyborg[bot] ***@***.***> wrote:
Thanks for opening your first issue here! We'll come back to you as soon
as we can.
In the meantime, check out the #python channel on our Powertools for AWS
Lambda Discord: Invite link <https://discord.gg/B8zZKbbyET>
—
Reply to this email directly, view it on GitHub
<#3327 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAZPQBDR4DXNEYVXHTMT2ZDYEJAHZAVCNFSM6AAAAAA7JMKN56VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMBYGQ2TQOBXGM>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***
.com>
|
… to return a copy of the item on failure and avoid a subsequent get aws-powertools#3327
… to return a copy of the item on failure and avoid a subsequent get aws-powertools#3327
… to return a copy of the item on failure and avoid a subsequent get aws-powertools#3327. Changes after PR comments
…havior with ReturnValuesOnConditionCheckFailure (#3446) * feat: add ReturnValuesOnConditionCheckFailure to DynamoDB idempotency to return a copy of the item on failure and avoid a subsequent get #3327 * feat: add ReturnValuesOnConditionCheckFailure to DynamoDB idempotency to return a copy of the item on failure and avoid a subsequent get #3327 * feat: add ReturnValuesOnConditionCheckFailure to DynamoDB idempotency to return a copy of the item on failure and avoid a subsequent get #3327. Changes after PR comments * Improving code readability * Reverting function * Adding comments about some logic decisions * Use DynamoDBPersistenceLayer passed in for test_idempotent_lambda_expired_during_request Co-authored-by: Leandro Damascena <[email protected]> Signed-off-by: Dan Straw <[email protected]> * Adding docs * wording * Adressing Ruben's feedback * Adressing Ruben's feedback --------- Signed-off-by: Dan Straw <[email protected]> Co-authored-by: Dan Straw <[email protected]> Co-authored-by: Leandro Damascena <[email protected]> Co-authored-by: Cavalcante Damascena <[email protected]>
|
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
The text was updated successfully, but these errors were encountered: