Question

Difficulty: MediumModernizing Workloads with Serverless Architectures (Lambda and API Gateway)

A manufacturing company is modernizing its warehouse inventory tracking system by refactoring a legacy monolithic application into a serverless architecture on AWS. The system must process barcode scanning events from multiple warehouses globally. These scans are ingested via Amazon API Gateway and processed by an AWS Lambda function that updates a central Amazon Aurora PostgreSQL database situated in a private VPC subnet. The volume of scans fluctuates significantly throughout the day, peaking at thousands of events per second during shift changes. During initial load testing, the application encounters database connection exhaustion errors, and other critical business functions in the same AWS account experience throttling. Which of the following actions should the Solutions Architect recommend to address these issues and ensure a reliable, scalable architecture? (Select TWO.)

  1. Establish an Amazon RDS Proxy endpoint within the VPC to pool and reuse database connections from the Lambda function to the Aurora PostgreSQL database.Answer
  2. Configure reserved concurrency for the Lambda function to limit its maximum concurrent executions, preventing it from exhausting the regional account concurrency pool.Answer
  3. C
    Deploy the Lambda function in a private VPC subnet and route all outbound traffic through a single NAT Gateway in one Availability Zone to reach the public API Gateway endpoints.
  4. D
    Encrypt the database credentials in AWS Systems Manager Parameter Store using the default AWS-managed KMS key (aws/kms) and grant cross-account access to the Lambda execution role in a separate operations account.
  5. E
    Configure a rolling update deployment strategy directly in the CloudFormation template for the Lambda function to allow automatic zero-downtime rollbacks based on CloudWatch alarms.

Answer

Establish an Amazon RDS Proxy endpoint within the VPC to pool database connections, and configure reserved concurrency for the Lambda function to limit its concurrent executions.
Establishing an Amazon RDS Proxy pools database connections, preventing the Lambda function from exhausting the PostgreSQL connection limit. Configuring reserved concurrency prevents the Lambda function from scaling unbounded and exhausting the regional concurrency limit, which would otherwise throttle other critical functions in the AWS account.

Step-by-Step Solution

1
Address database connection exhaustion by introducing a database proxy.
Amazon RDS Proxy pools connections, shielding the Aurora PostgreSQL database from connection spikes caused by highly concurrent Lambda executions.
Lambda scales horizontally by creating new execution environments, each of which establishes a new database connection. RDS Proxy intercepts these and manages a pool of persistent connections.
2
Protect the regional concurrency pool from depletion during traffic surges.
Reserved concurrency limits the maximum instances of the Lambda function that can run concurrently, preventing it from consuming the entire account's concurrency limits.
Without concurrency limits, a spike in inventory scans could exhaust the default account limit of 1,000 concurrent executions, causing all other functions in the region to fail with throttling errors.

Key Concept

Serverless connection pooling and concurrency management are critical when modernizing legacy workloads to Lambda and API Gateway to protect downstream resources and account limits.
Rate this question