Question

Difficulty: EasyAWS Compute Services

A company needs to run a database backup script every night at 2:00 AM. The script takes about 2 minutes to execute, and the company wants to minimize costs by only paying for the exact compute time used during execution, without maintaining any running servers. Which AWS compute service is best suited to meet this requirement?

  1. AWS LambdaAnswer
  2. B
    Amazon EC2
  3. C
    Amazon ECS
  4. D
    Amazon Lightsail

Answer

AWS Lambda is the most appropriate service because it runs code in response to events and charges only for the compute time consumed, making it cost-effective for short, scheduled scripts without the need to manage servers.
AWS Lambda is the correct choice because it is a serverless compute service that executes code in response to event triggers, such as a scheduled Amazon CloudWatch event. It scales automatically and charges only for the milliseconds of compute time used during execution, eliminating the cost of idle server time.

Step-by-Step Solution

1
Analyze the workload requirements
The workload is a short-running task (2 minutes) that runs once per day on a schedule, and the business wants to minimize management overhead and costs.
Understanding the execution duration and scheduling frequency helps identify the optimal compute tier.
2
Compare AWS compute services against the requirements
AWS Lambda allows running code serverlessly and paying only for the 2 minutes of execution. Services like Amazon EC2 or Amazon Lightsail require running instances that incur continuous hourly or monthly charges.
Evaluating against AWS billing models ensures the solution is cost-effective and serverless.

Key Concept

AWS Compute Services
Estimated Time:45s
Rate this question