When to use AWS Lambda and when to use Kubernetes (EKS)? When to use AWS Lambda and when to use Kubernetes (EKS)? kubernetes kubernetes

When to use AWS Lambda and when to use Kubernetes (EKS)?


They serve different purposes. If you want to have horizontal scalability on a "ec2/pod/container" level and handle the availability yourself (through k8s of course), go for Kubernetes.

If you have a straight forward function doing a particular thing and you don't want to bother yourself with operating costs of having to manage a cluster or packaging it, then you can let Lambda administer it for you (at the time of writing, you would pay 20 US cents per million call). It is just another layer of abstraction on top of a system that is probably similar to Kubernetes, scaling your function per needs.

The goal of these technologies is to remove as much overhead as possible between you and the code and infrastructure can be painful. To summarize, serverless is to Kubernetes what Kubernetes is to containers.

To make a conscious decision, take the following into account:

  • Does your budget covers operation and maintenance of infrastructure

  • Do you have the expertise in Kubernetes

  • How much would it cost to redesign your J2EE app into serverlessready code

  • Your timeline (of course...)

  • Based on the AWS resources you will use, how much do you save or notby implementing a k8s cluster (database service?, EBS, EC2s, etc.)