Soru

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

An automotive company is modernizing its vehicle telematics ingestion pipeline by migrating a legacy on-premises system to AWS. The new architecture must ingest telemetry payloads from over 100,000100,000 active vehicles, resulting in sudden traffic bursts of up to 10,00010,000 requests per second. The telemetry data must be processed and stored in an Amazon Aurora PostgreSQL database cluster deployed in a private subnet. Additionally, the processing components must securely perform outbound API calls to an external third-party service for real-time fleet health checks, and this outbound path must be highly available. The modernization must ensure that the database is protected from connection exhaustion, that telemetry data is not dropped during traffic bursts, and that the ingestion workload does not exhaust the regional AWS Lambda concurrency pool of the AWS account.

Which architectural design meets these requirements while maximizing reliability and performance efficiency?

  1. Configure Amazon API Gateway with an AWS service integration to publish incoming telemetry payloads directly to an Amazon SQS queue. Configure the Lambda function to be triggered by the SQS queue, and set the maximum concurrency on the SQS event source mapping to limit the number of concurrent executions. Deploy the Lambda function in private subnets across multiple Availability Zones, routing outbound internet traffic through a dedicated NAT Gateway in each Availability Zone. Configure the Lambda function to connect to the Aurora PostgreSQL database through an Amazon RDS Proxy.Cevap
  2. B
    Configure Amazon API Gateway to directly invoke the Lambda function synchronously. Set a reserved concurrency limit on the Lambda function to prevent it from exhausting the regional pool. Deploy the Lambda function in a single private subnet with a single NAT Gateway to manage outbound traffic to the fleet-health service. Configure the Lambda function to establish direct connections to the Aurora PostgreSQL database, relying on an in-memory connection pooling library within the function code.
  3. C
    Configure Amazon API Gateway with a regional endpoint that directly invokes the Lambda function. Configure the Lambda function to run in private subnets across multiple Availability Zones with outbound traffic routed through a single NAT Gateway. Have the Lambda function connect to the database via an Amazon RDS Proxy. Do not set any concurrency limits on the Lambda function, allowing it to scale dynamically to handle the telemetry bursts and minimize latency.
  4. D
    Configure Amazon API Gateway to invoke the Lambda function asynchronously using the Event invocation type. Configure the Lambda function to decrypt database credentials using the default AWS-managed KMS key. Deploy the Lambda function in private subnets across multiple Availability Zones, routing outbound internet traffic through a single NAT Gateway. Have the Lambda function connect directly to the Aurora PostgreSQL database, adjusting the database max_connections parameter to match the peak concurrent Lambda executions.

Cevap

Configure Amazon API Gateway with an AWS service integration to publish incoming telemetry payloads directly to an Amazon SQS queue. Configure the Lambda function to be triggered by the SQS queue, and set the maximum concurrency on the SQS event source mapping to limit the number of concurrent executions. Deploy the Lambda function in private subnets across multiple Availability Zones, routing outbound internet traffic through a dedicated NAT Gateway in each Availability Zone. Configure the Lambda function to connect to the Aurora PostgreSQL database through an Amazon RDS Proxy.
The correct design uses Amazon API Gateway to buffer bursts of telemetry traffic by integrating directly with Amazon SQS. SQS decouples the ingestion layer from the processing layer, preventing any data loss during spikes. Limiting the maximum concurrency on the SQS event source mapping ensures that the Lambda function does not consume the account's entire concurrency pool. Deploying the Lambda function in private subnets across multiple Availability Zones with dedicated NAT Gateways in each Availability Zone provides high availability for the outbound calls. Finally, Amazon RDS Proxy pools database connections, preventing Lambda from exhausting the Aurora PostgreSQL cluster's connections.

Adım Adım Çözüm

1
Analyze ingestion buffer requirements to handle traffic bursts.
Using API Gateway with a direct AWS service integration to Amazon SQS buffers incoming payloads, preventing 429429 throttles or dropped data from vehicles.
Vehicle telemetry bursts of up to 10,00010,000 requests per second require an asynchronous message queue to absorb traffic spikes without scaling the compute layer instantaneously or dropping requests.
2
Examine account concurrency protection.
Setting the maximum concurrency on the SQS-to-Lambda event source mapping limits concurrent Lambda executions.
This protects the account's regional concurrency pool (1,0001,000 executions by default) from exhaustion by the telemetry workload, ensuring other serverless applications in the same account remain functional.
3
Address database connection scaling.
Introduce Amazon RDS Proxy between the Lambda function and the private Aurora PostgreSQL cluster.
Aurora PostgreSQL uses a process-per-connection model. Under heavy Lambda concurrency, direct connections will exhaust database resources. RDS Proxy pools and reuses database connections to maintain performance.
4
Design highly available outbound network path.
Deploy the Lambda function in private subnets spanning multiple Availability Zones and route internet traffic through a NAT Gateway in each Availability Zone.
Outbound calls to the third-party fleet health API must be highly available. A single NAT Gateway is a single point of failure, so multiple NAT Gateways are required.

Anahtar Kavram

Decoupling bursty serverless workloads using SQS, managing Lambda concurrency boundaries, and optimizing database connections with RDS Proxy in a high-availability VPC design.
Bu soruyu puanla