- Newest
- Most votes
- Most comments
Based on your requirements, you need a solution that processes the first change immediately while batching subsequent changes. Here's how you could approach this:
You can use a combination of DynamoDB Streams and SQS to achieve your goal:
-
Set up DynamoDB Streams on your table to capture item-level modifications in real-time.
-
Create a Lambda function triggered by the DynamoDB Stream that:
- Identifies which system the change belongs to (using SystemID)
- For each SystemID, checks if this is the first change in a time window
- If it's the first change, processes it immediately
- If it's a subsequent change, sends a message to an SQS queue with a delay
-
Configure an SQS queue with a message delay of 5 minutes for batching purposes.
-
Create another Lambda function triggered by the SQS queue that:
- When triggered, queries the entire dataset for the specific SystemID
- Transforms the data into the required format
- Sends the complete dataset to the target system
This approach gives you the immediate processing for the first change while batching subsequent changes. SQS is better suited for this batching requirement than EventBridge, as EventBridge doesn't have built-in batching capabilities.
For audit and compliance purposes, you could also log all successful transactions and failed records to maintain a comprehensive audit trail of the data processing.
If you need to scale this solution for larger datasets, you can adjust the Lambda memory, timeout settings, and increase ephemeral storage as needed.
Sources
can AWS Event Bridge replace SQS? | AWS re:Post
Ingest CSV data to Amazon DynamoDB using AWS Lambda | AWS Database Blog
Write to Kinesis Data Streams using Amazon DynamoDB - Amazon Kinesis Data Streams
answered 10 months ago
Relevant content
asked 2 years ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated 7 months ago

is there a way to differentiate between self-sufficient "one off" API requests and partial batch requests when you have to wait for the entire batch to arrive before submitting it to the "system"?