Design Cost-Optimized Architectures A free question from our original SAA-C03 practice exam. Try it, then open the answer to see why each option is right or wrong.
A finance department uses an internal REST API that handles about 3,000 requests a day, almost all during office hours, and each request finishes in under 300 ms.
A few staff also use it in the evenings, so it must answer at any time of day. The API runs on two always-on Amazon EC2 instances behind an Application Load Balancer.
Which change will reduce cost the MOST while keeping the API available at all times?
Choose one answer.
AA. Rebuild the API on Amazon API Gateway HTTP APIs, with an AWS Lambda function behind each of its endpoints.
BB. Buy 3-year Reserved Instances for both EC2 instances, and keep the Application Load Balancer in front of them as it is.
CC. Add scheduled Auto Scaling actions that scale the instances in to zero after office hours and back out to two each morning.
DD. Move the API to an Amazon ECS service that runs one AWS Fargate task, behind the existing Application Load Balancer.
Show the answer and explanation
Answer: A
A. Right: Correct. API Gateway charges per request and Lambda charges per request and per unit of compute time, with no minimum fees. For 3,000 short requests a day the bill is a tiny fraction of two servers and a load balancer, and the API still answers at any hour. Learn more: Amazon API Gateway pricing (opens in a new tab)
B. Wrong: Reserved Instances lower the hourly rate of the instances, but the company still pays for two servers and a load balancer around the clock. The load balancer is billed for every hour it runs, and most of those hours carry almost no traffic. Learn more: Amazon EC2 billing and purchasing options (opens in a new tab)
C. Wrong: Scheduled scaling would remove most instance hours, but with no instances in the evening the staff who use the API then would get errors. The load balancer would also still be billed for every hour. This breaks the always-available requirement. Learn more: Scheduled scaling for Amazon EC2 Auto Scaling (opens in a new tab)
D. Wrong: One Fargate task costs less than two instances, but it still runs and is billed all day and night, and the load balancer's hourly charge remains. A single task also leaves no spare capacity if it fails. A request-priced service removes the idle cost entirely. Learn more: AWS Fargate for Amazon ECS (opens in a new tab)
Explanation
At about 3,000 short requests a day, the API is idle almost all the time, so the biggest saving comes from not paying for idle capacity at all. API Gateway and Lambda are billed per request and per unit of compute used, with no minimum fees, and they still answer in the evening. Every other option keeps a load balancer and at least one server or task billed around the clock, or loses evening availability.
Want more on Serverless pricing? The 5 full-length practice sets have 7 more Serverless pricing questions, 325 in all, none of them in the free exam. One payment of $14.99, no subscription. See the practice sets →