<p>We are trying to evaluate the best ways to scale our J2EE web application and use hosting services with AWS.  Are there reasons why we would use the Lambda service over Kubernetes (EKS)?  Although it seems that Lambda can scale functional units, I'm not clear why anyone would use that as a substitute for Kubernetes, given Kubernetes can replicate containers based on performance metrics.</p>

<p>They serve different purposes. If you want to have horizontal scalability on a &quot;ec2/pod/container&quot; level and handle the availability yourself (through k8s of course), go for Kubernetes.</p>
<p>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.</p>
<p>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.</p>
<p>To make a conscious decision, take the following into account:</p>
<ul>
<li><p>Does your budget covers operation and maintenance of infrastructure</p>
</li>
<li><p>Do you have the expertise in Kubernetes</p>
</li>
<li><p>How much would it cost to redesign your J2EE app into serverless
ready code</p>
</li>
<li><p>Your timeline (of course...)</p>
</li>
<li><p>Based on the AWS resources you will use, how much do you save or not
by implementing a k8s cluster (database service?, EBS, EC2s, etc.)</p>
</li>
</ul>
