Soru

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

An online education provider is modernizing its student enrollment application by migrating to a serverless architecture on AWS. The application will use a regional Amazon API Gateway REST API and AWS Lambda functions. The Lambda functions must process incoming enrollment requests, verify payment status by calling an external third-party payment gateway over the internet, and write records to a PostgreSQL database hosted on an Amazon RDS DB instance inside a private subnet of a VPC.

During peak registration periods, the enrollment API experiences massive, unpredictable spikes in traffic. The solutions architect must design a highly available architecture that prevents database connection exhaustion and ensures that these sudden surges in enrollment requests do not exhaust the regional concurrency pool, which would throttle other critical Lambda functions in the same AWS account.

Which of the following architectures meets these requirements?

  1. A
    Configure the Lambda functions to run in private subnets across multiple Availability Zones. Deploy a single NAT Gateway in one Availability Zone to handle outbound internet traffic to the external payment gateway. Deploy an Amazon RDS Proxy between the Lambda functions and the PostgreSQL database. Configure reserved concurrency on the enrollment Lambda function.
  2. Configure the Lambda functions to run in private subnets across multiple Availability Zones. Deploy a NAT Gateway in each Availability Zone to provide redundant outbound internet access to the external payment gateway. Deploy an Amazon RDS Proxy between the Lambda functions and the PostgreSQL database. Configure reserved concurrency on the enrollment Lambda function.Cevap
  3. C
    Configure the Lambda functions to run in private subnets across multiple Availability Zones. Deploy a NAT Gateway in each Availability Zone to provide redundant outbound internet access. Establish direct database connections from the Lambda functions to the PostgreSQL database. Configure provisioned concurrency on the enrollment Lambda function to handle the traffic spikes.
  4. D
    Configure the Lambda functions to run in private subnets across multiple Availability Zones. Deploy a NAT Gateway in each Availability Zone to provide redundant outbound internet access. Deploy an Amazon RDS Proxy between the Lambda functions and the PostgreSQL database. Store the database credentials in a centralized security account's AWS Secrets Manager encrypted with the default AWS-managed KMS key, and configure cross-account access for the Lambda execution role.

Cevap

The architecture that configures the Lambda functions in private subnets with a NAT Gateway in each Availability Zone, deploys an Amazon RDS Proxy, and sets reserved concurrency on the enrollment Lambda function.
The correct architecture deploys Lambda functions across multiple Availability Zones inside private subnets, with internet egress handled by a NAT Gateway in each Availability Zone for fault tolerance. Database connections are managed efficiently using Amazon RDS Proxy to handle pooling, and reserved concurrency limits the execution pool of the enrollment function, preventing it from exhausting the regional account-level concurrency limit and throttling other workloads.

Adım Adım Çözüm

1
Evaluate the egress networking requirements for outbound internet communication.
The Lambda functions must reside in private subnets across multiple Availability Zones, and outbound internet access must be provided through redundant NAT Gateways deployed in each Availability Zone to avoid a single point of failure.
Lambda functions inside a VPC require a NAT Gateway to access public internet endpoints like the payment gateway, and distributing NAT Gateways across Availability Zones ensures high availability.
2
Address database connection preservation during traffic surges.
Introduce Amazon RDS Proxy between the Lambda functions and the RDS PostgreSQL instance.
RDS Proxy maintains a pool of established database connections and shares them among concurrent Lambda executions, preventing the relational database from exhausting its connection limits during sudden surges.
3
Isolate the concurrency footprint of the enrollment function to protect other workloads in the account.
Configure reserved concurrency on the enrollment Lambda function.
Reserved concurrency sets a maximum limit on the number of concurrent executions for a specific function. This acts as a throttle for that function, preventing it from consuming the entire account's regional concurrency pool and thereby protecting other critical functions in the account.

Anahtar Kavram

Designing a scalable, highly available serverless architecture that integrates with relational databases and external endpoints while managing resource quotas (concurrency and connections).
Bu soruyu puanla