A developer has configured an Amazon DynamoDB table with DynamoDB Streams enabled to trigger an AWS Lambda function. The stream has a single active shard. During load testing, a high volume of database writes causes significant lag in stream processing because the Lambda function cannot keep up with the rate of incoming records. The developer needs to reduce the processing latency and resolve the lag while maintaining the order of processed records per partition key. Which configuration change will resolve the stream processing lag?
- AIncrease the Lambda function's execution timeout to ensure the execution context remains warm and automatically processes all subsequent batches in the stream.
- Increase the Parallelization Factor in the event source mapping configuration to process multiple batches from the shard concurrently.Cevap
- CIncrease the visibility timeout of the DynamoDB stream event source mapping to match the Lambda function's processing time.
- DConfigure the Lambda function to run inside a private VPC subnet to access the DynamoDB stream endpoint via a gateway VPC endpoint.
Cevap
Increase the Parallelization Factor in the event source mapping configuration to process multiple batches from the shard concurrently.
The correct answer is to increase the Parallelization Factor in the event source mapping configuration. By default, Lambda processes only one batch per shard in parallel. Increasing the Parallelization Factor allows Lambda to poll and execute up to 10 concurrent batches from a single shard in parallel. Order is still guaranteed at the partition-key level, which satisfies all requirements of the scenario.
Adım Adım Çözüm
Anahtar Kavram
Scaling stream processing throughput in Lambda event source mappings using Parallelization Factor.
Tahmini Süre:1m 30s