Posted On: Oct 30, 2019
We are announcing Batch Window for Amazon Lambda, a new feature that allows developers to fine tune Lambda invocation for cost optimization. This feature gives you additional control on batching behavior when processing data from Kinesis data streams and DynamoDB streams.
Lambda reads records from a stream at a fixed cadence (e.g. once per second for Kinesis data streams) and invokes a function with a batch of records. Batch Window allows you to wait as long as 300s to build a batch before invoking a function. Now, a function is invoked when one of the following conditions is met: the payload size reaches 6MB, the Batch Window reaches its maximum value, or the Batch Size reaches its maximum value. With Batch Window, you can increase the average number of records passed to the function with each invocation. This is helpful when you want to reduce the number of invocations and optimize cost.
You can get started with Batch Window with Amazon Web Services management console, CLI, API or SAM. It can be used at no additional cost in all regions where Amazon Lambda is available. For more information on where Amazon Lambda is available, see the Amazon Web Services region table. To learn more, see Using Amazon Lambda with Amazon Kinesis and Using Amazon Lambda with Amazon DynamoDB in the Amazon Lambda Developer Guide.