DVA-C02 · Question #106
A company needs to develop a proof of concept for a web service application. The application will show the weather forecast for one of the company's office locations. The application will provide a RE
The correct answer is B. Create an AWS Lambda function by using the AWS Serverless Application Model (AWS SAM).. AWS Lambda with API Gateway and SAM is the most cost-effective solution for low-traffic REST APIs because serverless compute incurs no cost when idle, and API Gateway's built-in caching reduces backend calls.
Question
A company needs to develop a proof of concept for a web service application. The application will show the weather forecast for one of the company's office locations. The application will provide a REST endpoint that clients can call. Where possible, the application should use caching features provided by AWS to limit the number of requests to the backend service. The application backend will receive a small amount of traffic only during testing. Which approach should the developer take to provide the REST endpoint MOST cost-effectively?
Options
- ACreate a container image. Deploy the container image by using Amazon Elastic Kubernetes
- BCreate an AWS Lambda function by using the AWS Serverless Application Model (AWS SAM).
- CCreate a container image. Deploy the container image by using Amazon Elastic Container
- DCreate a microservices application. Deploy the application to AWS Elastic Beanstalk. Expose the
How the community answered
(64 responses)- A27% (17)
- B58% (37)
- C9% (6)
- D6% (4)
Why each option
AWS Lambda with API Gateway and SAM is the most cost-effective solution for low-traffic REST APIs because serverless compute incurs no cost when idle, and API Gateway's built-in caching reduces backend calls.
Amazon EKS requires running worker nodes continuously, incurring EC2 costs even when handling zero traffic, making it far more expensive for a low-traffic POC.
AWS SAM simplifies deploying a Lambda function with API Gateway, which supports built-in response caching at the stage level. Because Lambda billing is based on invocation count and duration rather than reserved capacity, a proof-of-concept with minimal traffic incurs near-zero cost during idle periods, satisfying both the caching and cost-effectiveness requirements.
ECS with running tasks or instances also incurs continuous compute costs regardless of traffic volume.
Elastic Beanstalk maintains at least one running EC2 instance, resulting in continuous charges unsuitable for minimal-traffic proof-of-concept scenarios.
Concept tested: Serverless REST API cost optimization with API Gateway caching
Source: https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-caching.html
Community Discussion
No community discussion yet for this question.