Spring Boot vs Quarkus vs Micronaut with JDBC on Java 25
Spring Boot vs Quarkus vs Micronaut with JDBC on Java 25
A previous JPA-vs-JDBC experiment convinced me to use JDBC for future small-framework comparisons, so I followed it up by adding Micronaut and building equivalent Spring Boot, Quarkus, and Micronaut applications.
All three used the same Java 25 runtime, H2 database, SQL, fixture data, request workload, and JVM flags. I ran each independently for 15 minutes in the same 1 GiB / 2 vCPU Ubuntu VM.
One JVM caveat that came up in feedback from the Quarkus community: all three were run explicitly with G1GC. On this 1 GiB VM, without specifying the collector, HotSpot would have selected Serial GC by default.
Results:
- Spring Boot: 4.90 s readiness, 214.3 MiB median RSS
- Quarkus: 2.25 s, 178.4 MiB
- Micronaut: 2.54 s, 186.7 MiB
Quarkus had the lowest whole-run median RSS and reached readiness fastest. Micronaut was fairly close, especially later in the run: during the final five minutes their median RSS was 189.7 MiB for Quarkus and 189.4 MiB for Micronaut.
Spring used more resident memory in this setup, though all three completed the same workload without errors.
CPU use was low across the board, so this isn't a throughput benchmark or an attempt to rank the frameworks generally. It's one controlled look at three equivalent small JDBC applications.
Full write-up:
https://pvrlabs.xyz/articles/spring-boot-quarkus-micronaut-jdbc.html
Sources, method, raw data, and analysis:
https://github.com/PVRLabs/experiments/tree/main/statlite/spring-quarkus-micronaut-jdbc
I’m especially curious how these Micronaut JVM numbers line up with what people here see in practice.
11
u/Deniss_Larka Oct 06 '26
A no-framework would make these numbers easier to read. Same SQL, same H2 file, plain JDBC, and the JDK's built-in HttpServer or bare Jetty. H2 runs embedded here, so its cache sits inside every RSS number too. Then you see how much of the 180 to 215 MiB is the framework and how much is the JVM, H2 and the data.
3
u/fifth_partial Oct 07 '26
Spring Boot dev here. This post just really makes me wish I still had my Micronauts.
9
u/john16384 Oct 06 '26
In other words, barely worth switching framework for. Still good to know.
2
u/cryptos6 Oct 08 '26
Helidon would be an interesting addition, as it offers a refreshingly different approach to this kind of framework.
1
u/cowwoc Oct 08 '26
I think ease-of-development and maintability matters more in the long run and, for me at least, Spring is a non-starter. Newer frameworks are simpler and more intuitive to pick up and maintain over time.
1
u/Ironman5566 Oct 06 '26
What about if you use spring AOT? The other two frameworks use AOT by default I guess
1
u/Fercii_RP Oct 06 '26
Compare them AOT/natively compiled would be more interesting imo
1
u/voronaam Oct 06 '26
I run a serverless java application on AWS Lambda. It is using Micronaut and my readiness in practice is in a single digit milliseconds range. I am horrified by your 2.54s for it. If my Lambda would take that long to start, I would not be able to run a backend this way. It usually takes about 10ms for the AWS to initialize the Lambda environment and about 1ms from the time the control is handled over to my Micronaut code to where it first polls for the HTTP request to process.
I do not watch the memory though. The whole thing is teared down in a few seconds and a new lambda takes over.
1
u/sgrinovero Oct 07 '26
As I explained previously in https://www.reddit.com/r/quarkus/comments/1wyebbm/comment/pe35ljw/ , measuring in this way you're only confirming the capability of the JVM to make itself comfortable and grab all the memory it can. You're not comparing the frameworks, you're only seeing small differences because of the minimal side effects that the framework choice has on RSS in this case: the number of classes being loaded in Spring is obviously higher so it will consume slightly more.
But this doesn't highlight at all that Quarkus could for example perform much better than Spring if you constrain the resources.
4
u/jonenst Oct 06 '26
Did you try (as I mentionned in my other post) some rss optimizing flags ?
I recently started using the following flags and it made a huge difference without much performance drawbacks: