Soru

Zorluk: OrtaModernizing Workloads with Serverless Architectures (Lambda and API Gateway)

An airline is modernizing its legacy loyalty reward points redemption backend by migrating it to a serverless architecture on AWS. The solution will expose a public REST API via Amazon API Gateway, which triggers an AWS Lambda function. This function processes transactions, updates customer records in a private Amazon Aurora PostgreSQL database, and calls an external loyalty-partner API over the public internet to validate partner reward points. During promotional events, traffic is expected to spike from a baseline of 5050 requests per second to over 50005000 requests per second. The architect must ensure that database connections are managed efficiently to prevent database overload, that sudden traffic spikes do not consume the entire account-level concurrent execution pool (which would throttle other critical serverless workloads in the same AWS account), and that all outbound traffic to both the private database and the public internet remains highly available and resilient to Availability Zone outages.

Which architectural design meets these requirements?

  1. Deploy the Lambda function across private subnets in multiple Availability Zones, routing outbound internet traffic through redundant NAT Gateways in each Availability Zone. Configure Amazon RDS Proxy to manage connections to the Aurora PostgreSQL database, and configure a reserved concurrency limit for the Lambda function.Cevap
  2. B
    Deploy the Lambda function across private subnets in multiple Availability Zones, routing all outbound internet traffic through a single NAT Gateway in one Availability Zone to minimize NAT Gateway costs. Configure Amazon RDS Proxy to manage connections to the Aurora PostgreSQL database, and configure a reserved concurrency limit for the Lambda function.
  3. C
    Deploy the Lambda function across private subnets in multiple Availability Zones, routing outbound internet traffic through redundant NAT Gateways in each Availability Zone. Configure Amazon RDS Proxy to manage connections to the Aurora PostgreSQL database, and rely on the regional unreserved concurrency pool to allow the function to scale dynamically to meet demand.
  4. D
    Deploy the Lambda function across private subnets in multiple Availability Zones, routing outbound internet traffic through redundant NAT Gateways in each Availability Zone. Configure Amazon RDS Proxy to manage connections to the Aurora PostgreSQL database. Store database credentials in AWS Secrets Manager and enable cross-account access using the default AWS-managed key (aws/secretsmanager) in the secrets policy. Configure a reserved concurrency limit for the Lambda function.

Cevap

Deploy the Lambda function across private subnets in multiple Availability Zones, routing outbound internet traffic through redundant NAT Gateways in each Availability Zone. Configure Amazon RDS Proxy to manage connections to the Aurora PostgreSQL database, and configure a reserved concurrency limit for the Lambda function.
The correct option addresses all three design goals: using redundant NAT Gateways across Availability Zones ensures high availability for outbound partner API calls; Amazon RDS Proxy prevents database connection exhaustion; and reserved concurrency prevents the high-volume function from exhausting the regional concurrency pool and throttling other workloads in the account.

Adım Adım Çözüm

1
Analyze high availability requirements for outbound traffic.
To ensure that outbound traffic to the internet (for the partner API) is highly available and resilient to Availability Zone (AZ) outages, the Lambda function must be deployed in private subnets across multiple AZs, and each AZ's subnet route table must point to a local NAT Gateway in a public subnet of that same AZ.
If all subnets route through a single NAT Gateway, that gateway represents a single point of failure if its AZ experiences an outage.
2
Address database connection scaling and pooling.
Configure Amazon RDS Proxy between the Lambda function and the Aurora PostgreSQL database.
Lambda functions scale horizontally by creating new execution environments, which can quickly exhaust the database's connection pool. RDS Proxy pools and shares database connections to improve scalability.
3
Protect other workloads in the same AWS account from concurrency exhaustion.
Configure a reserved concurrency limit on the loyalty reward points redemption Lambda function.
By setting reserved concurrency, you limit the maximum concurrent executions for this specific function, preventing it from consuming the entire regional account-level concurrency pool (typically 1000 by default) and throttling other critical serverless applications.

Anahtar Kavram

Architecting serverless workloads with Lambda and API Gateway for high availability, connection pooling, and account-level concurrency protection.
Tahmini Süre:2m 0s
Bu soruyu puanla