A company is migrating its customer-facing booking application to a serverless architecture using Amazon API Gateway and AWS Lambda. The backend Lambda function integrates with a legacy third-party inventory database that can only support a maximum of 30 concurrent database connections. During peak hours, traffic spikes cause the database to crash due to too many simultaneous connections from the Lambda function. Which configuration should the solutions architect implement to limit the concurrent executions of the Lambda function to a maximum of 30?
- Configure reserved concurrency with a limit of 30 on the Lambda function.Answer
- BConfigure provisioned concurrency with a value of 30 on the Lambda function.
- CConfigure a canary deployment in Amazon API Gateway to limit traffic to 30% of peak capacity.
- DSet up an AWS KMS customer managed key to encrypt the Lambda environment variables and limit concurrent decryptions to 30.
Answer
Configure reserved concurrency with a limit of 30 on the Lambda function.
Configuring reserved concurrency on the Lambda function sets a strict maximum limit on the number of concurrent executions. This ensures that the function will never open more than 30 connections to the legacy database, preventing it from crashing during high traffic periods.
Step-by-Step Solution
Key Concept
AWS Lambda Reserved Concurrency