r/JavaProgramming • u/fykup • 7d ago
Experimenting with a lightweight alternative to Spring Boot for small servers
I've been working on CoilBase, a small open-source Java foundation built around a simple idea: Spring-like comfort, without the weight.
I like Spring Boot's controller → service → repository structure, but wanted to preserve that development experience with a smaller runtime footprint.
CoilBase uses Jdbi for SQL-first persistence, explicit transactions, and constructor wiring. It works with lightweight HTTP frameworks like Javalin and Avaje Jex.
I recently compared five Java application stacks on a 512 MiB VM with MariaDB running alongside the application.
On HotSpot JDK 27, median application memory was:
Spring Boot + Spring JDBC: 181–188 MiB
Javalin + CoilBase: 121–136 MiB
Jex + CoilBase: ~116 MiB
The same CoilBase services and repositories worked across Javalin, Jex, and Micronaut. I also tested GraalVM Native Image, with even smaller footprints.
GitHub: https://github.com/PVRLabs/coilbase
Experiment and results: https://pvrlabs.xyz/articles/five-java-stacks-512mb-vps.html
Curious what others think of this approach. Would you consider a smaller, explicitly wired stack for a small Java service, or do you generally stick with Spring Boot?
2
2
u/BanaTibor 6d ago
Nice fun project!
Although I can not see it justified. In the opening post you show a 70MB memory consumption difference, that is nothing today. I think you would get much closer results with Graalvm and Quarkus. At the end it comes down to familiarity and adoption. Quarkus is mature and well maintained and developed further, yet it barely can make a dent in Spring's dominance.