A company is modernizing a legacy web application by migrating its API to Amazon API Gateway and AWS Lambda. The application's backend database is an Amazon RDS for MySQL DB instance. During testing, peak traffic causes the Lambda functions to exhaust the database's available connection pool, leading to connection timeout errors. Additionally, the solutions architect must ensure that the database credentials are secure and that the application is resilient to traffic spikes. Which TWO configurations should the solutions architect implement to resolve the connection scaling issues and prevent database overload? (Select TWO.)
- Create and configure an Amazon RDS Proxy between the Lambda functions and the RDS database instance to manage and pool connections.Answer
- Configure reserved concurrency on the Lambda functions to limit the maximum number of concurrent executions to a level the database can handle.Answer
- CConfigure the Lambda functions in the private subnets to route all database traffic through a single NAT Gateway in a single Availability Zone to serialize requests.
- DLeave the Lambda functions' concurrency unconfigured to allow the system to scale infinitely without throttling during traffic spikes.
- EUse the default AWS-managed KMS key (aws/secretsmanager) to encrypt database credentials in AWS Secrets Manager and configure cross-account access for Lambda functions in other testing accounts.
Answer
The correct configurations are to use Amazon RDS Proxy to pool database connections, and to configure reserved concurrency on the Lambda functions to limit the maximum concurrent executions.
The correct configurations are to use Amazon RDS Proxy to pool database connections and to set reserved concurrency limits on the Lambda functions. Amazon RDS Proxy pools and shares database connections, which prevents Lambda from exhausting the DB instance's connection limits during scaling. Configuring reserved concurrency prevents the Lambda functions from scaling beyond the database's capacity, which protects the database and ensures other functions in the account are not throttled due to concurrency exhaustion.
Step-by-Step Solution
Key Concept
AWS Lambda integrates with Amazon RDS Proxy to pool database connections, and uses reserved concurrency to prevent connection exhaustion and database resource overload.