I have an application whose execution time is short but is very critical.
For keeping my costs minimum for running the application, what is the best AWS Compute service that I can use?
Click on the arrows to vote for the correct answer
A. B. C. D.Answer: B.
Option A is incorrect.
Although spot instances offer very low compute prices, they are most useful in situations where you have flexible start & end times for your applications.
Since time criticality is an important aspect for application execution, spot instances may not be the best fit here which can be terminated within a short notice period.
Option B is CORRECT.With AWS lambda, code gets executed only when needed & AWS automatically takes care of dynamically provisioning / de-provisioning compute capacity to execute the Lambda function.
Also known as serverless computing technology, users pay only for the duration of the lambda function execution & they do not need to provision or manage servers.
This is the best possible way to dramatically reduce costs without managing idle time of unused compute capacity.
Option C is incorrect.
Although Standard Reserved Instances provide up to 75% off on-demand price, they are more useful for steady-state or predictable applications.
Since our scenario only talks about limited usage, RI may not be a good choice.
Option D is incorrect.
On-demand EC2 instances need to be provisioned & managed by the user.
You also need to account for idle compute time & terminate instances that are idle which otherwise will have cost implications.
Diagram:
Depicts a serverless architecture using API Gateway, Lambda, Dynamo DB streams for an Employee Attendance system.
References:
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-spot-instances.html https://aws.amazon.com/lambda/ https://d1.awsstatic.com/whitepapers/serverless-architectures-with-aws-lambda.pdf https://aws.amazon.com/ecs/?whats-new-cards.sort-by=item.additionalFields.postDateTime&whats-new-cards.sort-order=desc&ecs-blogs.sort-by=item.additionalFields.createdDate&ecs-blogs.sort-order=descIf you have an application with a short execution time that is very critical and you want to keep your costs minimal, the best AWS Compute service that you can use is Lambda function.
Lambda function is a serverless compute service that allows you to run code without provisioning or managing servers. It automatically scales to handle the incoming requests and bills you only for the time your code runs.
This makes Lambda function a perfect fit for short-running, critical applications as it eliminates the need for long-term infrastructure management, reduces operational costs, and ensures high availability.
On the other hand, Spot Instances are a cost-effective option for workloads that can handle interruptions and have flexible start and end times. They are ideal for applications that can be interrupted and resumed, such as batch processing, scientific computing, and data analysis.
Reserved Instances are used for applications that have a steady-state usage, while On-Demand Instances are used for workloads that require consistent performance and low latency.
In conclusion, if you have a short-running, critical application, you should consider using Lambda function. It will help you keep your costs minimal while ensuring high availability and scalability.