Spring Boot vs Javalin + Jdbi: HotSpot and GraalVM on a 512 MiB VM
I've been experimenting with how far a small Java backend can be trimmed down while keeping useful application structure.
After optimizing a Spring Boot 4 application with Spring AOT and a JDK AOT cache, I rebuilt the same database-backed Market Replay application using Javalin 7 and Jdbi.
Both ran on a 512 MiB / 1 vCPU VM without swap, alongside MariaDB and a small HTTP quote fixture. The application periodically ingests quotes into MariaDB and serves latest-price and history endpoints.
HotSpot JDK 27
| Metric | Spring Boot | Javalin + Jdbi |
|---|---|---|
| Median app RSS | 186.9 MiB | 159.1 MiB |
| Readiness | 3.79 s | 2.72 s |
| HTTP p95 | 5.54 ms | 5.59 ms |
| Successful requests | 1,500/1,500 | 1,500/1,500 |
Javalin used 27.8 MiB (14.9%) less application RSS, with similar latency at the tested load.
GraalVM Native Image (JDK 25)
Both applications were also compiled using Oracle GraalVM 25 at the same O2 optimization level.
| Metric | Spring Boot | Javalin + Jdbi |
|---|---|---|
| Median app RSS | 107.0 MiB | 65.5 MiB |
| Readiness | 0.183 s | 0.113 s |
| HTTP p95 | 4.84 ms | 4.34 ms |
| Minimum host MemAvailable | 204.9 MiB | 204.1 MiB |
| Successful requests | 1,500/1,500 | 1,500/1,500 |
The native results were particularly interesting: Javalin used 41.5 MiB less application RSS, but available host memory was almost identical. Lower process RSS doesn't always translate into more usable memory for the VM.
Beyond the numbers
The main tradeoff wasn't just performance.
Spring Boot provides integrated MVC, persistence, transactions, health checks, metrics and application wiring. With Javalin, these responsibilities need to be assembled explicitly.
For persistence, I used Jdbi with a small experimental repository abstraction providing SQL selection and explicit transaction callbacks. I've published the experiment source and transaction tests alongside the measurements, and I'm interested in feedback on whether these conventions add value over plain Jdbi.
These are single-run comparisons of complete application stacks, not isolated framework benchmarks or throughput tests. HotSpot uses JDK 27, while Native Image uses JDK 25.
Full article (charts, methodology, and discussion):
https://pvrlabs.xyz/articles/spring-boot-vs-javalin-jdbi.html
Experiment source and results:
https://github.com/PVRLabs/experiments/tree/main/javalin/market-replay-jdk27
Jdbi persistence source and transaction tests:
https://github.com/PVRLabs/experiments/tree/main/javalin/market-replay-jdk27/persistence-example
For smaller Java services, do you prefer Spring Boot's integrated approach, or lighter frameworks where you assemble the pieces yourself?