r/SpringBoot • u/khan_awan • Sep 16 '26
Question JOOQ vs JDBC
I use JPA for simple CRUD operations (mostly write operations) and JDBC for performance intensive tasks such as sending lists & performing search. The JDBC performance is perfect & the performance of my backend (Spring Boot) is great.
Now, as my project grows, my SQL queries are getting bigger, messier and unreadable. I tried jOOQ and loved it because it made my code super readable, type safe and maintainable. However, after profiling my Spring Boot app, operations that took around 5 ms with JDBC now take 9–14 ms with jOOQ, which makes me reluctant to migrate to jOOQ. Is a 10 ms difference negligible or am I overthinking?
I love the cleanliness and type safety of JOOQ. Would you go this JOOQ route? Have you ever faced such situation? I visited JOOQ's official website and was stunned by the fact it is used by many big organizations
EDIT: Thank you everyone who answered, your insights were amazing. With some tweaks I was able to reduce JOOQ's operation time from 14ms to 7ms and now I have so much clarity in my head.
View all comments
Show parent comment
1
u/Radhad85 Sep 18 '26
Sure if you never learned that or "let Hibernate create my database at start" - sure your database design will be a mess. Small service where each table is an object might work well in most cases but with higher complexity your objects need data from multiple tables so a flat table to object doesn't fit well.
To be honest, I sometimes still use pen & paper for database planning but most of the time one of the digital tools before implementing anything.