I have a Lambda function which pushes DynamoDB stream messages to SNS. If I put batch size as 10, can it combine records of two different streams?
For instance: Stream1 has an array of 2 objects and Stream2 also has an array of 2 objects. If I put batch size as 10, will lambda create 2 batches (one for each stream) or will it combine objects of both the streams and put them under single batch. Assuming both streams hit Lambda at the same time.
From DynamoDB Streams and AWS Lambda Triggers - Amazon DynamoDB:
If you enable DynamoDB Streams on a table, you can associate the stream Amazon Resource Name (ARN) with an AWS Lambda function that you write. Immediately after an item in the table is modified, a new record appears in the table's stream. AWS Lambda polls the stream and invokes your Lambda function synchronously when it detects new stream records.
Therefore, the Lambda function only retrieves messages from a single DynamoDB stream. If the batch size is configured to retrieve multiple records, those records will all be retrieved from the same stream.