Throttle Amazon DynamoDB writes with Amazon SQS

Amazon SQS → AWS Lambda → Amazon DynamoDB

Preventing Amazon DynamoDB write throttling with an Amazon SQS queue-based buffer

This code demonstrates how an Amazon SQS queue can be used to buffer records for an Amazon DynamoDB table and mitigate the risk of a client of being throttled.
The SAM template deploys ingress and dead-letter queues, a Lambda function, and the destination DynamoDB table.
The Lambda function will use a partial batch response to return throttled records back to the queue.
The function uses Node.js 18 runtime running on ARM64 processors powered by AWS Graviton.

< Back to all patterns

GitHub icon Download this pattern (.zip)

GitHub icon View this pattern on GitHub


Clone repo

git clone https://github.com/aws-samples/serverless-patterns/cd serverless-patterns/sqs-lambda-ddb-sam-ts

Deploy

sam buildsam deploy --guided


Testing

See the GitHub repo for detailed testing instructions.

Cleanup

Delete the stack: sam delete --stack-name STACK_NAME.

Created by:

Dmitry Gulin

Dmitry Gulin

Modernization Architect, AWS

Follow on LinkedIn