Medium java spring

ECS, EKS, Lambda or EC2 for Java workloads: how do you choose?

The 30 second answer

ECS on Fargate is my default for running containers without managing servers. EKS makes sense when the team needs Kubernetes features or portability and can operate it. Lambda fits spiky, short, event-driven work, and SnapStart helps with Java cold starts, but there is a fifteen-minute limit. EC2 is for special needs, like a tuned JVM, special hardware, or licensing.

ECS on Fargate is the simplest way to run containers without managing servers. EKS is for teams that need Kubernetes features or portability and can run it. Lambda fits spiky, event-driven, short tasks; Java cold starts can be cut with SnapStart. Note Lambda's 15-minute limit. EC2 gives full control for special needs such as tuned JVMs or licensing. AWS has a decision guide for exactly this choice. Follow-up: Long-running Spring Boot API with steady traffic? (ECS Fargate or EKS, not Lambda.)

Sources (3)
  1. AWS: Choosing an AWS container service
  2. Lambda SnapStart
  3. Lambda quotas