
Explanation:
The best choice is Use an AWS Lambda Python function behind Amazon API Gateway and enable provisioned concurrency. Provisioned concurrency pre-initializes execution environments so requests from API Gateway return quickly and consistently, and the approach remains serverless with minimal operations. Containerize the Python script and run it on Amazon ECS with EC2 launch type behind an Application Load Balancer requires managing EC2 capacity, AMIs, scaling, and load balancers, which is unnecessary overhead for a small, on-demand API-backed routine. Create an AWS Lambda function in Python and try to keep it warm using an Amazon EventBridge Scheduler rule that invokes it every 2 minutes is unreliable for eliminating cold starts, especially during bursts or scaling, and wastes invocations. It does not guarantee consistently low latency. Run the Python routine as a service on Amazon ECS with AWS Fargate reduces instance management but still demands container image builds, service configuration, and potential idle cost or startup lag, making it heavier than Lambda for this use case. When the question stresses minimal ops and predictable low latency for synchronous API calls, think Lambda + provisioned concurrency. Avoid ad hoc warming tricks or container orchestration unless there are sustained workloads or container-specific needs.
Ultimate access to all questions.
An online learning startup runs a React single-page app that calls REST endpoints through Amazon API Gateway. The data engineering team needs a Python routine that can be invoked on demand via API Gateway and must synchronously return its result to the caller with predictable startup latency and minimal operations work. Which solution should they choose?
A
Containerize the Python script and run it on Amazon ECS with EC2 launch type behind an Application Load Balancer
B
Create an AWS Lambda function in Python and try to keep it warm using an Amazon EventBridge Scheduler rule that invokes it every 2 minutes
C
Use an AWS Lambda Python function behind Amazon API Gateway and enable provisioned concurrency
D
Run the Python routine as a service on Amazon ECS with AWS Fargate
No comments yet.