Question

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

A retail enterprise is modernizing its legacy order processing system by migrating it to a serverless architecture on AWS. The new architecture uses an Amazon API Gateway API that triggers an AWS Lambda function. The Lambda function processes orders and updates an Amazon RDS for PostgreSQL database located in a private VPC subnet. The database also serves other business-critical reporting applications. During promotional sales, the system experiences high-volume, bursty traffic. The solutions architect must ensure that the order-processing Lambda functions do not exhaust the RDS database connection limit, and that these traffic bursts do not throttle other Lambda functions in the same AWS account. Which design should the solutions architect implement to satisfy these requirements?

  1. A
    Deploy the Lambda function in a single private subnet pointing to a single NAT Gateway. Direct the Lambda function to connect directly to the RDS database using a custom connection pooling library in the function code, and configure reserved concurrency.
  2. B
    Deploy Amazon RDS Proxy in the VPC to manage the database connection pool. Configure provisioned concurrency on the order-processing Lambda function without setting a reserved concurrency limit.
  3. Deploy Amazon RDS Proxy in the VPC to manage the database connection pool. Configure reserved concurrency on the order-processing Lambda function.Answer
  4. D
    Deploy Amazon RDS Proxy in the VPC. Configure the Lambda function to access database credentials using an AWS KMS AWS-managed key shared from a central security account, and configure reserved concurrency.

Answer

Deploy Amazon RDS Proxy in the VPC to manage the database connection pool. Configure reserved concurrency on the order-processing Lambda function.
The correct architecture uses Amazon RDS Proxy to pool and reuse database connections, preventing the scaled Lambda instances from overwhelming the database connection limits. Furthermore, setting reserved concurrency on the Lambda function acts as a maximum limit of execution environments, preventing a spike in order processing from exhausting the regional account-level concurrency pool and throttling other functions.

Step-by-Step Solution

1
Address database connection limits.
Using Amazon RDS Proxy allows pooling and sharing of database connections, protecting the PostgreSQL database from connection exhaustion caused by rapid horizontal scaling of AWS Lambda.
Serverless functions spin up rapidly and open individual connections, which can quickly exceed database connection limits.
2
Address Lambda concurrency sharing and throttling prevention.
Configure reserved concurrency on the order-processing Lambda function.
Reserved concurrency reserves a portion of the account's concurrency pool for this function while also acting as a concurrency ceiling. This prevents the function from scaling out of control and consuming the entire regional concurrency pool, which would otherwise throttle other functions in the same account.

Key Concept

To successfully modernize workloads with serverless architectures using AWS Lambda and API Gateway, solutions architects must manage resource scaling boundaries. This includes using Amazon RDS Proxy to shield databases from connection exhaustion and configuring reserved concurrency limits to prevent high-volume functions from starving other serverless workloads in the same AWS account.
Estimated Time:2m 0s
Rate this question