DVA-C02 practice question 10 of 35

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…

Full set: 598 questions

Domain Development with AWS Services

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?
Answer options
A: Create a container image. Deploy the container image by using Amazon EKS. Expose the functionality by using Amazon API Gateway.
B: Create an AWS Lambda function by using AWS SAM. Expose the Lambda functionality by using Amazon API Gateway. Correct answer
C: Create a container image. Deploy the container image by using Amazon ECS. Expose the functionality by using Amazon API Gateway.
D: Create a microservices application. Deploy the application to AWS Elastic Beanstalk. Expose the AWS Lambda functionality by using an Application Load Balancer.
Correct Answer:
B. Create an AWS Lambda function by using AWS SAM. Expose the Lambda functionality by using Amazon API Gateway.
Explanation

The most cost-effective approach for a proof of concept with minimal, intermittent traffic is a serverless architecture. AWS Lambda functions are billed based on the number of requests and execution duration, meaning there are no costs when the application is idle. This aligns perfectly with the "small amount of traffic only during testing" requirement. Amazon API Gateway provides the necessary REST endpoint and has built-in caching capabilities to limit requests to the backend Lambda function, fulfilling another key requirement. AWS Serverless Application Model (SAM) is the standard framework for efficiently defining and deploying such serverless applications, making this the optimal solution.

Why Incorrect

A. Amazon EKS has a control plane cost and requires running worker nodes, making it expensive and overly complex for a simple, low-traffic proof of concept.
C. Amazon ECS, even with AWS Fargate, is less cost-effective than Lambda for very low traffic, as it provisions resources for longer durations than a single Lambda invocation.
D. AWS Elastic Beanstalk provisions underlying resources like EC2 instances and an Application Load Balancer, which incur continuous costs regardless of traffic, making it unsuitable for this use case.

References

1. AWS Lambda Pricing: "With AWS Lambda

you pay only for what you use. You are charged based on the number of requests for your functions and the duration... The Lambda free tier includes 1M free requests per month." This supports the cost-effectiveness for low traffic.

Source: AWS Lambda Pricing

aws.amazon.com/lambda/pricing/.

2. Amazon API Gateway Caching: "You can enable API caching in Amazon API Gateway to cache your endpoint's responses. With caching

you can reduce the number of calls made to your endpoint and also improve the latency of requests to your API."

Source: AWS API Gateway Developer Guide

"Enabling API caching to enhance responsiveness".

3. AWS Serverless Application Model (SAM): "The AWS Serverless Application Model (AWS SAM) is an open-source framework for building serverless applications. It provides shorthand syntax to express functions

APIs

databases

and event source mappings."

Source: AWS SAM Developer Guide

"What is the AWS Serverless Application Model (AWS SAM)?".

4. AWS Compute Services Overview: The official documentation often presents Lambda as the ideal choice for event-driven workloads with infrequent or unpredictable traffic

contrasting it with container services (ECS/EKS) for long-running applications and Elastic Beanstalk for traditional web applications.

Source: AWS Whitepaper

"AWS Well-Architected Framework - Serverless Applications Lens"

Page 5

"When to choose a serverless approach".

Scroll to Top