Hacker News new | ask | show | jobs
by vbezhenar 1733 days ago
Thanks for article. Today I learned about Project Leyden, whose primary goal will be to address the long-term pain points of Java’s slow startup time, slow time to peak performance, and large footprint.

I just recently started to explore Quarkus, GraalVM to optimize Java microservices for cloud architecture. It's good to know that Java moves into that direction.

https://mail.openjdk.java.net/pipermail/discuss/2020-April/0...

1 comments

> to optimize Java microservices for cloud architecture

I'm kind of curious about this. What kind of lifetimes are you looking at for JVMs? Are you trying to use Java in lambdas on demand to user requests? What kind of warmup time are you seeing right now?

I'm personally interested in reducing RAM consumption. Right now Spring Boot application with very little functionality (like few REST endpoints, talking to database) easily eats few hundreds of megabytes RAM. Similar node.js application eats few dozens of megabytes RAM. Cost of using Java is high, when there are plenty of those services, especially when we're talking about resilient services and launching 2-3 instances of every service.

Fast startup time is just a good bonus.

That's for my use-case. Lambdas, obviously, demand fast start-up.

To be fair, that's spring boot. It's a bloated ecosystem. If you write using lean libraries (which you'd want to do for lambda anyway) then you're looking at 0.1-0.3s jvm startup times. If that's supposed to be serving a user then it may be taking too long, but in that case use an EC2 instance rather than trying to be serverless.
what woud be a lean alternative for microservices to spring boot?
The most lean and interesting alternative IMO is Helidon SE. It's backed by Oracle and uses very sane approach.

The most pragmatic alternative IMO is Quarkus. I don't really like it, but it seems to be the most popular alternative to Spring and probably will become standard de facto, unless Spring will jump ahead with some revolutionary changes. It's backed by Red Hat and seems to have the most momentum.

The best approach IMO is not here yet. Frameworks, mentioned above, rely heavily on reactive architecture. It's just not needed with Project Loom, so there's plenty of unnecessary complications. They even rewriting JDBC drivers.

I'm going with Quarkus for now, but I'm waiting for ideal framework to appear.

What's your opinion on vert.x vs quarkus? For more general purpose web stuff, it seemed to me vert.x had more libraries.

Also, as for database, I really got fed up with hibernate (all configuration and stuff), do you know any simpler asynchronous / reactive alternative that handles object mapping? (automatically serializing from / into SQL objects).

Micronaut is worth a look
Lambdas, commandline applications, everything which needs startup times in the range of a few milliseconds.