AWS Certified DevOps Engineer – ProfessionalResilient Cloud SolutionsMedium

A development team is building a serverless application using AWS Lambda functions and Amazon API Gateway. They need to ensure that their Lambda functions can handle sudden, large increases in invocation requests without performance degradation or error, maintaining consistent response times. Which architectural pattern should they consider for their Lambda functions?

  1. AUsing SQS as an event source to decouple Lambda invocations.
  2. BProvisioned Concurrency for critical Lambda functions.
  3. CIncreasing the memory allocation for all Lambda functions.
  4. DImplementing a dead-letter queue (DLQ) for failed invocations.
Show answer & explanation

Correct answer: B. Provisioned Concurrency for critical Lambda functions.

Provisioned Concurrency keeps Lambda functions initialized and ready to respond, eliminating cold starts and ensuring low latency even during sudden spikes in traffic. This is crucial for maintaining consistent response times under heavy load.

Why the other options are wrong

  • A. Using SQS as an event source decouples the producer and consumer, improving resiliency and allowing asynchronous processing. However, it doesn't solve the cold start problem for the Lambda functions themselves when they are invoked from SQS, and the question implies direct invocation via API Gateway for 'consistent response times'.
  • C. Increasing memory allocation can improve performance for CPU-bound or memory-intensive tasks, but it does not prevent cold starts or guarantee consistent response times during sudden, high-volume invocations.
  • D. A Dead-Letter Queue (DLQ) handles failed function invocations by sending them to a queue for later analysis, improving fault tolerance but not directly addressing performance under high load or cold start issues.

Lambda Provisioned Concurrency

Provisioned Concurrency for AWS Lambda pre-initializes a specified number of execution environments, ensuring that functions are ready to respond instantly to invocation requests with very low latency.

  • Eliminates cold starts for immediate responsiveness.
  • Ensures consistent low latency during traffic spikes.
  • Configured per function version or alias.
  • Incurs cost for the provisioned concurrency, even if not invoked.

Memory trick: Provisioned Concurrency for instant Lambda readiness.

More Resilient Cloud Solutions questions