Repository navigation
feat(idempotency): adding redis as idempotency backend - #2567
Conversation
… the idempotency key
Signed-off-by: Vandita Patidar <vandita.vk20@gmail.com>
Signed-off-by: Vandita Patidar <vandita.vk20@gmail.com>
|
No acknowledgement section found. Please make sure you used the template to open a PR and didn't remove the acknowledgment section. Check the template here: https://github.com/aws-powertools/powertools-lambda-python/blob/develop/.github/PULL_REQUEST_TEMPLATE.md#acknowledgment |
|
No related issues found. Please ensure there is an open issue related to this change to avoid significant delays or closure. |
rubenfonseca
left a comment
There was a problem hiding this comment.
Just tiny things, super close now :D
Cool! I'm 100% convinced this is the best approach. Thanks for the explanation! |
graph TD;
A(Existing orphan record in redis)--without lock-->A1;
A1[Two Lambda invoke at same time]-->B1[Lambda handler1];
B1-->B2[Fetch from Redis];
B2-->B3[Handler1 got orphan record];
B3-->B4[Handler1 overwrite orphan record];
B4-->B5[Handler1 continue to execution];
A1-->C1[Lambda handler2];
C1-->C2[Fetch from Redis];
C2-->C3[Handler2 got orphan record];
C3-->C4[Handler2 overwrite orphan record];
C4-->C5[Handler2 continue to execution];
B5-->D(Lambda handler executed twice!);
C5-->D;
graph TD;
A(Existing orphan record in redis)--with lock-->A1;
A1[Two Lambda invoke at same time]-->B1[Lambda handler1];
B1-->B2[Fetch from Redis];
B2-->B3[Handler1 got orphan record];
B3-->B4[Handler1 acquired lock];
B4-->B5[Handler1 overwrite orphan record]
B5-->B6[Handler1 continue to execution];
A1-->C1[Lambda handler2];
C1-->C2[Fetch from Redis];
C2-->C3[Handler2 got orphan record];
C3-->C4[Handler2 failed to acquire lock];
C4-->C5[Handler2 wait and fetch from Redis];
C5-->C6[Handler2 return without executing];
B6-->D(Lambda handler executed only once!);
C6-->D;
|
rubenfonseca
left a comment
There was a problem hiding this comment.
Just some small things left
rubenfonseca
left a comment
There was a problem hiding this comment.
Awesome work everyone!
|

Issue number: #1181
previous pr: #1914
Summary
PR adds support for Redis as Idempotecny backend
Changes
The following features for Redis are currently supported by this PR
User experience
User can now use Redis as backend. You can connect it using Redis Standalone or Redis Cluster as shown in the example.
Checklist
If your change doesn't seem to apply, please leave them unchecked.
Is this a breaking change?
RFC issue number:
Checklist:
Acknowledgment
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.