I'm evaluating a solution approach using Docker containers. Now that lambda is also supporting container images this falls in my consideration too.
I'm evaluating based on the following factors
Any other factor I need to consider between the 2 services?
Although both services allow you to run Docker images now, they both have different application types they target.
Typically, you want a Docker container to run for while and not just a few seconds. Furthermore, you often would have the "whole" application in a Docker image.
Lambda offers you short running compute power (seconds to minutes) for small tasks, not a whole application (they are called Lambda functions). So comparing them using your "metrics" might not be the right approach.
First, you need to find out for how long you want your containers to run. If the answer is longer than 900 seconds, you don't need to compare Fargate to AWS Lambda, since Lambda can only run for a maximum of 900 seconds.
Second, you need to check what you actually want to run in the container. As I said before, Lambdas are made for small, short running functions, not "hosting" whole applications (e.g. web servers with Node/Rails/Django apps). If you want to run a whole application on Lambda, you would need to decompose it. Static files on S3 etc., and backend API with AWS API Gateway and AWS Lambda.
That said, if you really want your containers to run less than 900s and want to compare between the two, then here are a few more ideas:
Some of those depend heavily on your experience, team and your practices, but should be factored in.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With