You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/utilities/idempotency.md
+52-4
Original file line number
Diff line number
Diff line change
@@ -79,10 +79,10 @@ As of now, Amazon DynamoDB is the only supported persistent storage layer, so yo
79
79
80
80
If you're not [changing the default configuration for the DynamoDB persistence layer](#dynamodbpersistencelayer), this is the expected default configuration:
| Partition key |`id`| The id of each idempotency record which a combination of `functionName#hashOfPayload`. |
85
+
| TTL attribute name |`expiration`| This can only be configured after your table is created if you're using AWS Console. |
86
86
87
87
???+ tip "Tip: You can share a single state table for all functions"
88
88
You can reuse the same DynamoDB table to store idempotency state. We add the Lambda function name in addition to the idempotency key as a hash key.
@@ -767,6 +767,54 @@ This means that we will raise **`IdempotencyKeyError`** if the evaluation of **`
767
767
}
768
768
```
769
769
770
+
### Batch integration
771
+
772
+
You can easily integrate with [Batch](batch.md) utility by using idempotency wrapper around your processing function.
773
+
This ensures that you process each record in an idempotent manner, and guard against a [Lambda timeout](#lambda-timeouts) idempotent situation.
774
+
775
+
???+ "Choosing a unique batch record attribute"
776
+
In this example, we choose `messageId` as our idempotency key since we know it'll be unique.
777
+
Depending on your use case, it might be more accurate [to choose another field](#choosing-a-payload-subset-for-idempotency) your producer intentionally set to define uniqueness.
The **`clientConfig`** and **`awsSdkV3Client`** parameters enable you to pass in custom configurations or your own [DynamoDBClient](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/dynamodb/){target="_blank"} when constructing the persistence store.
0 commit comments