r/java • • 6d ago

Migrating Java Applications to AWS Serverless: A Practical Guide

https://javarevisited.substack.com/p/migrating-java-applications-to-aws
0 Upvotes

7 comments sorted by

33

u/fykup 6d ago

Migrating a typical Java app to Lambda is a great way to spend more money and get worse latency while fighting the runtime. Or you could just put it on a cheap VPS, keep the warm JVM and connection pools it was designed for, and scale by adding more instances. Turns out that still works.

8

u/vips7L 6d ago

Vendor lock-in as a service

3

u/MarkZuccsForeskin 6d ago

cool article but aws is soooo overpriced these days, especially with the availability of ai, theres not much excuse not to just use a vps

2

u/persicsb 6d ago

Isn't serverless apps deprecated since they have such an overhead overall, that they did not worth it? An Amazon Prime Video engineer had a great example: https://www.infoq.com/news/2023/05/prime-ec2-ecs-saves-costs/

1

u/aoeudhtns 4d ago

As always it depends on your usecase. Lambdas cost more to run when all things are equal, but can potentially save you money when not in use. Other serverless options like Fargate can scale to zero as well but then keep the service warmed up, but that costs more than plain ECS. Or you can use K8s, but then you're paying to run your system nodes full-time even if your app can scale to zero. But if you are running a platform for the whole organization w/ K8s, then that probably doesn't matter because there's probably a reason to have something up at any given time.

1

u/wickedaze 6d ago

I worked on a project many years ago where management forced us to use lambdas with Java. Forget about using spring or any decent framework. Startup time was insane. Had to keep all the lambdas warm through cloudwatch. Finally I did a poc with a ec2 cluster to show the difference in latency. It was night and day

1

u/gjosifov 6d ago

The sales pitch for this type of compute is only pay when you use it
but there are bugs, like infinite loop bugs
who is going to pay for that ?

Maybe there is an option so you can kill the compute, but given that AWS is the origin story of the dark patterns UI design in , hardly anyone can find it, especially in stressful situations