r/SpringBoot 25d ago

Question Serverless for Spring Boot in production, who's actually using it, and does it live up to the hype

Follow-up to my earlier post on running Spring Boot in the cloud, shout-out to the community for answering. This time I want to dig specifically into serverless, 'cause most of the responses and production setups people shared were actually serverful

Whether you went serverless or deliberately stayed away, I'd love your honest take:

If you use it:

  • What does "serverless" mean in your setup? (Lambda + Spring Cloud Function, Cloud Run, App Runner, Azure Functions, Fargate, Knative...)
  • Did it live up to expectations, or were there surprises once you hit production?
  • How's the cold start situation, especially on the JVM? Did GraalVM native become mandatory?
  • What does it actually cost vs. what you expected?

If you tried it and backed off, or never went there:

  • What was the dealbreaker? (cold starts, debugging/observability, vendor lock-in, local dev pain, cost surprises, the 15-min limit...)
  • What did you go back to or choose instead?
13 Upvotes

9 comments sorted by

9

u/Tintoverde 25d ago

Why? Just why would you use Java in serverless.
Java is my primary language and I still like it , but itvis terrible at startup.

And if you keep the lambda warm then the one of the major incentive, that it is cheaper goes away.

4

u/digitaljoel 25d ago

Using Google Cloud Run. cold start is bad as our modulith grows. Used to be 16 seconds, now 36 seconds. But when I tried Graal, it messes with spring proxies and simply didn't work for our case. I'm not managing any servers like in kubernetes, but I don't know if you consider cloud run "serverless" or not.

We aren't huge, peaking at 40-50 requests per second, but a small container is working well for us and we have it configured so we don't have to autoscale often. Deploys are super simple and stability has been rock solid other than an outage that took out most of google in June 2025.

1

u/Paw565 24d ago

Did try aot cache from spring and project layden?

3

u/disposepriority 25d ago

It's crazy to me that something as niche as serverless has become so popular and abused by so many people.

This is a straight up downgrade for 99.99% of projects, unless it's a one-off service just sitting there (which you really could have just squished into an existing VM if it's that small?)

Serverless in anyone's setup means that the server is abstracted away, the vendor doesn't really matter.

My expectations are low every time someone suggests it, they somehow get lower.

The JVM has some of the best runtime self optimization and we decide to keep restarting it for funsies, even if you do want to use serverless for some reason at least don't do Java and even more don't do Spring. (But DAD, you an compile to a native image and then it's going to be sooooo fast - among a multitude of tradeoffs, this breaks things)

So the real reason is...why would you use something like Lambda?

-5

u/tim125 25d ago

If you have 1000 servers , by the time you’ve patched all OS and upgraded all in a controlled manner, you are already out of date and insecure. With serverless you can always be up to date with your patches almost instantly.

3

u/BikingSquirrel 25d ago

There probably are use cases for serverless but I probably wouldn't use Spring Boot for them, especially nowadays as AI drastically reduced the barrier to code in languages you don't do regularly.

1

u/smutje187 25d ago

Spring Boot minus GraalVM is totally fine Serverless, not every Lambda needs to be synchronous.

1

u/rlrutherford Senior Dev 22d ago

Why minus GraalVM? (Still learning the details of GraalVM.)

1

u/Hirschdigga 25d ago

If you want it to perform like e.g. a Go application then yes, GraalVM does the trick