File tree 1 file changed +30
-0
lines changed
1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -649,6 +649,36 @@ sequenceDiagram
649
649
< i> Idempotent request during and after Lambda timeouts< / i>
650
650
< / center>
651
651
652
+ # ### Optional idempotency key
653
+
654
+ < center>
655
+ ```mermaid
656
+ sequenceDiagram
657
+ participant Client
658
+ participant Lambda
659
+ participant Persistence Layer
660
+ alt request with idempotency key
661
+ Client-> > Lambda: Invoke (event)
662
+ Lambda-> > Persistence Layer: Get or set idempotency_key = hash (payload)
663
+ activate Persistence Layer
664
+ Note over Lambda,Persistence Layer: Set record status to INPROGRESS . < br> Prevents concurrent invocations < br> with the same payload
665
+ Lambda-- >> Lambda: Call your function
666
+ Lambda-> > Persistence Layer: Update record with result
667
+ deactivate Persistence Layer
668
+ Persistence Layer-- >> Persistence Layer: Update record
669
+ Note over Lambda,Persistence Layer: Set record status to COMPLETE . < br> New invocations with the same payload < br> now return the same result
670
+ Lambda-- >> Client: Response sent to client
671
+ else request(s) without idempotency key
672
+ Client-> > Lambda: Invoke (event)
673
+ Note over Lambda: Idempotency key is missing
674
+ Note over Persistence Layer: Skips any operation to fetch, update, and delete
675
+ Lambda-- >> Lambda: Call your function
676
+ Lambda-- >> Client: Response sent to client
677
+ end
678
+ ```
679
+ < i> Optional idempotency key< / i>
680
+ < / center>
681
+
652
682
# # Advanced
653
683
654
684
# ## Persistence layers
You can’t perform that action at this time.
0 commit comments