exam questions

Exam AWS Certified Solutions Architect - Professional SAP-C02 All Questions

View all questions & answers for the AWS Certified Solutions Architect - Professional SAP-C02 exam

Exam AWS Certified Solutions Architect - Professional SAP-C02 topic 1 question 68 discussion

A company runs a Python script on an Amazon EC2 instance to process data. The script runs every 10 minutes. The script ingests files from an Amazon S3 bucket and processes the files. On average, the script takes approximately 5 minutes to process each file The script will not reprocess a file that the script has already processed.

The company reviewed Amazon CloudWatch metrics and noticed that the EC2 instance is idle for approximately 40% of the time because of the file processing speed. The company wants to make the workload highly available and scalable. The company also wants to reduce long-term management overhead.

Which solution will meet these requirements MOST cost-effectively?

  • A. Migrate the data processing script to an AWS Lambda function. Use an S3 event notification to invoke the Lambda function to process the objects when the company uploads the objects.
  • B. Create an Amazon Simple Queue Service (Amazon SQS) queue. Configure Amazon S3 to send event notifications to the SQS queue. Create an EC2 Auto Scaling group with a minimum size of one instance. Update the data processing script to poll the SQS queue. Process the S3 objects that the SQS message identifies.
  • C. Migrate the data processing script to a container image. Run the data processing container on an EC2 instance. Configure the container to poll the S3 bucket for new objects and to process the resulting objects.
  • D. Migrate the data processing script to a container image that runs on Amazon Elastic Container Service (Amazon ECS) on AWS Fargate. Create an AWS Lambda function that calls the Fargate RunTaskAPI operation when the container processes the file. Use an S3 event notification to invoke the Lambda function.
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
masetromain
Highly Voted 2 years, 3 months ago
Selected Answer: A
The correct answer is A, migrating the data processing script to an AWS Lambda function and using an S3 event notification to invoke the Lambda function to process the objects when the company uploads the objects. This solution meets the company's requirements of high availability and scalability, as well as reducing long-term management overhead, and is likely to be the most cost-effective option. Option B involves creating an SQS queue and configuring S3 to send event notifications to it. The data processing script would then poll the SQS queue and process the S3 objects that the SQS message identifies. While this option also provides high availability and scalability, it is less cost-effective than using Lambda, as it requires additional resources such as an SQS queue and an EC2 Auto Scaling group.
upvoted 21 times
hamimelon
1 year, 7 months ago
Agree. Also, it says the company does not wanna manage long-term overhead, which points to serverless.
upvoted 2 times
...
dpatra
1 year, 6 months ago
SQS is out of the question because the script already has a built in logic that will prevent it to reprocess a message that's already been processed
upvoted 1 times
...
masetromain
2 years, 3 months ago
Option C, migrating the data processing script to a container image and running it on an EC2 instance, would still require the company to manage the underlying EC2 instances and may not be as cost-effective as using Lambda. Option D, migrating the data processing script to a container image that runs on Amazon ECS on AWS Fargate, would still require the company to manage the underlying infrastructure and may not be as cost-effective as using Lambda. Additionally, it introduces additional complexity by adding a Lambda function that calls the Fargate RunTask API operation.
upvoted 5 times
red_panda
1 year, 1 month ago
ECS in Fargate mode you don't need to manage anything underling infra! You're totally forgot about cost, for sure running an ECS Fargate has lower cost than running a Lambda for 5 minutes every 10 minutes! Also the function to trigger the ECS workload (in option D), running for milliseconds (as need only to notify the doc upload in S3), so it's more correct the D answer. Ask to any Gen AI model, you will have mine answer with more details :)
upvoted 1 times
NirvanaSNM
9 months, 1 week ago
Use an S3 event notification to invoke the Lambda function to process the objects
upvoted 1 times
...
...
...
...
zhangyu20000
Highly Voted 2 years, 3 months ago
A is correct, it provide HA, scale, less management. Task only need 5 minutes B: enen more complex C: container still run on one EC2, not scale d: need container, Farget and Lambda. Complex than A
upvoted 7 times
...
albert_kuo
Most Recent 1 month, 3 weeks ago
Selected Answer: A
+----------------------+ | Amazon S3 | | (Stores Uploaded Files)| +----------------------+ | | (S3 Event Notification) v +----------------------+ | AWS Lambda | | (Processes Files) | +----------------------+ | | (Processed Data) v +----------------------+ | Amazon S3 | | (Stores Processed Data)| +----------------------+
upvoted 1 times
...
SIJUTHOMASP
5 months ago
Option with Lambda would be more reasonable because the rational behind the cost on the solution would be triggering lambda on the S3 event. The current behaviour is 40% of EC2 being not utilised so that Option D to run in ECS with Fargate would be costlier than Lambda option here
upvoted 1 times
...
amministrazione
8 months ago
A. Migrate the data processing script to an AWS Lambda function. Use an S3 event notification to invoke the Lambda function to process the objects when the company uploads the objects.
upvoted 1 times
...
MAZIADI
8 months, 2 weeks ago
Selected Answer: A
instead of scheduled 10 min with multiple files processing (each takes 5 minutes) it will be event driven with lambda each time a file is uploaded --> Answer A
upvoted 1 times
...
zolthar_z
9 months, 2 weeks ago
Selected Answer: A
A, the company wants to reduce management overhead not costs, we should stay with the question requirement, it doesn't said anything about cost, probably D will be cheaper but the solution must resolve the question necessity and is reduce long-term management overhead
upvoted 2 times
...
Helpnosense
10 months, 2 weeks ago
Selected Answer: D
I vote D because the service is from EC2 to lambda and work is processing data. Without given how big is the data we can't assume that the data is always below the lambda ephemeral storage limit 0.5GB. Nowadays, a file can easily break 0.5GB. While D is still EC2 based so whatever previous EC2 can do farget can do as well.
upvoted 1 times
...
Shenannigan
10 months, 2 weeks ago
Selected Answer: A
The answer is A: AWS Pricing Calculator (using: 10,000 request per month, 300,000 ms which = 5 minutes 128 MB of Memory 512 MB of Storage ) Amount of memory allocated: 128 MB x 0.0009765625 GB in a MB = 0.125 GB Amount of ephemeral storage allocated: 512 MB x 0.0009765625 GB in a MB = 0.5 GB Pricing calculations 10,000 requests x 300,000 ms x 0.001 ms to sec conversion factor = 3,000,000.00 total compute (seconds) 0.125 GB x 3,000,000.00 seconds = 375,000.00 total compute (GB-s) 375,000.00 GB-s x 0.0000166667 USD = 6.25 USD (monthly compute charges) 10,000 requests x 0.0000002 USD = 0.00 USD (monthly request charges) 0.50 GB - 0.5 GB (no additional charge) = 0.00 GB billable ephemeral storage per function Lambda costs - Without Free Tier (monthly): 6.25 USD For those thinking D is the cheaper option, do you really believe ECS Fargate would be cheaper?
upvoted 2 times
...
red_panda
1 year, 1 month ago
Selected Answer: D
Ok i was thinking between A and D. I'm pretty sure which is D our answer, see the details. The requirements are: - COST as much as possible low - OPERATIONS as much as possible managed. So at the first reading, the A option seems to be the correct option (because it's totally AWS managed), but here we're totally forgot the cost. Running a Lambda function, for 5 minutes every 10 minutes, it's very very more expensive than a simple ECS task running continously. Finally, ECS in fargate mode is totally AWS managed, so we will have lower cost, and a serverless and HA environment, which auto-scale if we need more processing at time. For me, option D is the correct answer.
upvoted 3 times
...
gofavad926
1 year, 1 month ago
Selected Answer: A
A, use lambda function is much cost-effective than use ECS Margate
upvoted 1 times
...
8608f25
1 year, 2 months ago
Selected Answer: A
Option A is the most cost-effective and efficient solution. AWS Lambda allows for running code in response to triggers such as S3 event notifications without the need to manage servers, thereby directly addressing the requirement to reduce long-term management overhead. Since the script is only needed when new files are uploaded and takes about 5 minutes to process each file, Lambda’s ability to scale automatically and its billing model based on actual compute time used make it an ideal solution. Lambda can process files immediately upon upload, maximizing efficiency and minimizing idle time. Option D proposes using Amazon ECS on AWS Fargate with Lambda to trigger tasks. This solution introduces container orchestration, which can improve scalability and reduce some management overhead. However, it is not as cost-effective as directly invoking a Lambda function to process files, considering the lightweight nature of the task and the added complexity of managing container orchestration and Lambda functions together.
upvoted 1 times
...
LazyAutonomy
1 year, 2 months ago
Selected Answer: D
100% the answer is D. 5 minutes to process EACH FILE? And the EC2 instance is processing files 60% of the time? Lambda would be crazy expensive in this scenario. ECS/Fargate = cheaper for sure. See link in @covabix879 comment for proof of this. Greyeye said something rather ridiculous: "If you get 1000 images, you will see 1000 tasks. That is not economical or cheap." How can 1x EC2 instance running a script every 10 minutes process 1000 images with each one taking 5 minutes? Even if the script processed images in parallel, e.g. one image per vCPU at a time, that instance would need 500 vCPUs! For the EC2 instance to be idle 40% of the time, it would need 833 vCPUs. That's ridiculous. But even if 1000 images suddenly appeared, the Lambda solution would still result in 1000 Lambdas all firing and running for 5 minutes each. Which is going to be more expensive than ECS/Fargate.
upvoted 2 times
...
ninomfr64
1 year, 3 months ago
Selected Answer: A
A = correct B = does not reduce long-term management overhead C = does not reduce long-term management overhead D = does not reduce long-term management overhead Note: D is a cheap options as mentioned by other here below could be cheaper than A. However, in addition to maintaining the script code it requires to maintain the container image and the lambda
upvoted 1 times
...
severlight
1 year, 5 months ago
Selected Answer: A
in the real world it might be D, but with provided details and keeping in mind lambda retries in case of A, I would vote for A.
upvoted 1 times
...
Sandeep_B
1 year, 6 months ago
Selected Answer: A
D is more complex and overload for administration. Hence Vote for A
upvoted 1 times
...
covabix879
1 year, 6 months ago
Selected Answer: D
https://blogs.perficient.com/2021/06/17/aws-cost-analysis-comparing-lambda-ec2-fargate/ Even Fargate running continuosly is cheaper than Lambda running half of the time. So long running work load not cost effective with Lambda ( Every 10 minutes run for 5 minutes. So half of the time lambda is running) Therefore Fargate is the most cost-effective solution.
upvoted 5 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago