AWS Certified Data Engineer Associate · Free Practice Question Medium
Question 12
A startup is developing a serverless application with a Vue.js frontend, which interacts with a backend via Amazon API Gateway. They need to execute a Python script to run data processing tasks based on API requests and return the results. The script will be executed infrequently, and minimizing management overhead is a priority.
Which approach should the startup take to meet these requirements most efficiently?
-
A
Implement the Python script as an AWS Glue job and trigger it with API Gateway using AWS SDK integrations.
-
B
Host the Python script on an Amazon EC2 instance and set up an API Gateway endpoint to trigger the script execution.
-
C
Create an AWS Lambda function using Python, triggered by API Gateway, to run the script and return the response.
-
D
Use AWS Fargate to run a containerized version of the Python script and configure API Gateway for the Fargate service.
Reveal correct answer
Correct answer: C
Explanation
Using an AWS Lambda function for the Python script, aligns with the requirement for low operational overhead while ensuring scalability. Lambda's integration with Amazon API Gateway enables the script to be triggered on-demand, running only when needed, which is cost-efficient for the startup's occasional use.
The infrastructure management is fully handled by AWS, which means no server maintenance worries for the startup. This setup not only simplifies the deployment process but also guarantees that the backend can handle varying loads, making it a suitable choice for applications with unpredictable traffic patterns.
CORRECT: "Create an AWS Lambda function using Python, triggered by API Gateway, to run the script and return the response" is the correct answer (as explained above.)
INCORRECT: "Host the Python script on an Amazon EC2 instance and set up an API Gateway endpoint to trigger the script execution" is incorrect.
Hosting on an Amazon EC2 instance requires managing the underlying server, including security patches and scaling, which adds operational overhead
INCORRECT: "Use AWS Fargate to run a containerized version of the Python script and configure API Gateway for the Fargate service" is incorrect.
AWS Fargate allows you to run containers without managing servers or clusters but is more suitable for applications that need continuous running or complex orchestration, which is unnecessary for infrequent script execution.
INCORRECT: "Implement the Python script as an AWS Glue job and trigger it with API Gateway using AWS SDK integrations" is incorrect.
AWS Glue is a managed ETL service that can be overkill for simple script execution and does not provide real-time responses as efficiently as Lambda when integrated with API Gateway.
References:
https://docs.aws.amazon.com/lambda/latest/dg/services-apigateway.html
Save time with our AWS cheat sheets:
https://digitalcloud.training/aws-certified-data-engineer-associate-cheat-sheet/
Discussion
Think the marked answer is wrong, or have a better explanation? Share it below — comments appear after review.
