Question

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

A logistics company is modernizing its legacy telemetry system by migrating to a serverless architecture on AWS. The new application uses Amazon API Gateway to receive real-time GPS payloads from delivery vehicles, which are processed by an AWS Lambda function. During peak hours, a massive surge in vehicle transmissions causes the Lambda function to scale rapidly, exhausting the account's regional concurrency pool. Consequently, other business-critical applications in the same account are being throttled. The company needs a solution to prevent the telemetry function from consuming all account concurrency while ensuring that telemetry data is not lost during spikes. Which architectural solution will meet these requirements with the least operational overhead?

  1. A
    Configure provisioned concurrency on the Lambda function to handle the peak telemetry traffic, and request an increase in the AWS account's regional concurrency limit from AWS Support.
  2. B
    Configure the Lambda function to run inside a private subnet of a single VPC Availability Zone with a single NAT Gateway to access downstream databases, and increase the API Gateway integration timeout.
  3. Configure reserved concurrency on the Lambda function to limit its maximum concurrency. Re-architect the integration by configuring Amazon API Gateway to write telemetry payloads directly to an Amazon Simple Queue Service (SQS) queue, and configure the Lambda function to consume messages from the queue.Answer
  4. D
    Enable Amazon API Gateway caching to store the telemetry payloads, and encrypt the cache using the default AWS-managed KMS key for API Gateway to allow cross-account client applications to decrypt the payload directly.

Answer

Configure reserved concurrency on the Lambda function to limit its maximum concurrency, configure Amazon API Gateway to write telemetry payloads directly to an Amazon Simple Queue Service (SQS) queue, and configure the Lambda function to consume messages from the queue.
The correct solution involves configuring reserved concurrency on the Lambda function to place a hard limit on its concurrent executions. This ensures the function cannot scale out of control and exhaust the entire regional pool, thereby protecting other critical services. To prevent data loss when incoming request volumes exceed this concurrency limit, Amazon API Gateway is integrated directly with Amazon SQS using a service integration, buffering the payloads. The Lambda function then consumes messages from the queue at a controlled rate, guaranteeing that telemetry data is processed without being dropped.

Step-by-Step Solution

1
Analyze the concurrency exhaustion issue and identify that a spike in incoming telemetry requests triggers rapid scaling of the Lambda function, consuming the regional pool.
Confirming the need for a mechanism to restrict the maximum concurrency of the validation function (Reserved Concurrency) to protect other applications.
By default, a function can scale to consume the entire account's regional concurrency pool, causing starvation for other functions.
2
Evaluate the requirement to prevent data loss during traffic spikes while keeping operational overhead low.
Selecting Amazon SQS as a buffer between API Gateway and Lambda.
API Gateway can write directly to SQS using a service integration, which decouples the ingestion from processing and ensures payloads are queued rather than dropped if the processing Lambda is throttled.
3
Integrate the components and ensure configuration matches AWS best practices.
The final architecture uses API Gateway -> SQS -> Lambda with reserved concurrency, satisfying all requirements.
This setup isolates the compute consumption, guarantees message persistence, and maintains high availability without managing complex server infrastructure.

Key Concept

Modernizing legacy workloads using serverless architectures (API Gateway, SQS, and Lambda) with concurrency controls to ensure high availability and prevent resource starvation.
Estimated Time:2m 0s
Rate this question