<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/pj3fejdde" -->

---
title: Spring Boot JPA vs JDBC | daily.dev
description: A benchmark comparing two identical small Spring Boot 4.1.1 apps on JDK 25, one using Spring Data JPA with Hibernate and the other using JdbcTemplate directly....
canonical: https://daily.dev/posts/pj3fejdde
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Spring Boot JPA vs JDBC | daily.dev
og:description: A benchmark comparing two identical small Spring Boot 4.1.1 apps on JDK 25, one using Spring Data JPA with Hibernate and the other using JdbcTemplate directly....
og:url: https://daily.dev/posts/pj3fejdde
og:image: https://api.daily.dev/og/posts/pj3FeJDDe.png
og:image:alt: Post cover image
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Spring Boot JPA vs JDBC

**[Just Java](https://daily.dev/sources/justjava)** · [@ejboy](https://daily.dev/ejboy) · 32 upvotes · 8 comments

## Summary

A benchmark comparing two identical small Spring Boot 4.1.1 apps on JDK 25, one using Spring Data JPA with Hibernate and the other using JdbcTemplate directly. The JdbcTemplate version used roughly 90 to 91 MiB less resident memory (about 38% less) and reached its first successful dashboard response in about half the time (3.9-4.2s vs 8.1-8.8s). The author argues Hibernate can be more machinery than small applications with simple data models need, though it acknowledges the test is limited to two reversed-order runs on one macOS host and that memory savings matter more on constrained VPS environments than on large servers.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://pvrlabs.xyz/java-performance/experiments/spring-boot-jpa-vs-jdbc.html>

## Community discussion

Top comments from developers on daily.dev.

**@miguelsquillari** · 3 upvotes

> i always use jdbctemplate in my projects are much faster than jpa.

**@ristotoldsep** · 2 upvotes

> For a small service, JdbcTemplate can just get on with it. Hibernate can stay in the cupboard.

**@ahmetozel** · 1 upvotes

> Checking the three fixture counts and JVM metrics establishes that both dashboards work, but it does not yet establish equivalent persistence behavior. Before treating the cheaper variant as a replacement, I would add a failure during a multi-statement refresh and a concurrent-update case, then verify rollback and the resulting database state in both applications.
>
> That matters because the JDBC version moves behavior previously supplied by repositories and transactions into its own service code. Your explicit complete-variant limitation is useful here: the footprint advantage can be real...

## Similar posts on daily.dev

- [Quarkus has great performance – and we have new evidence](https://daily.dev/posts/quarkus-has-great-performance-and-we-have-new-evidence-hovnrhjip) · Quarkus · 17 upvotes · 1 comments
- [Spring, Quarkus,Jooby, or Vert.x: Java Framework Comparison](https://daily.dev/posts/spring-quarkus-jooby-or-vert-x-java-framework-comparison-xbdsfwtwa) · Foojay.io · 15 upvotes · 0 comments
- [GraalVM: Fast Java, Fine Print](https://daily.dev/posts/graalvm-fast-java-fine-print-fgozwvxtr) · Medium · 11 upvotes · 0 comments

---

Tags: [#performance](https://daily.dev/tags/performance), [#java](https://daily.dev/tags/java), [#spring-boot](https://daily.dev/tags/spring-boot)

[View this post on daily.dev](https://daily.dev/posts/pj3fejdde)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"DiscussionForumPosting","mainEntityOfPage":"https://daily.dev/posts/pj3fejdde","headline":"Spring Boot JPA vs JDBC","text":"Shared: Spring Boot JPA vs JDBC","url":"https://daily.dev/posts/pj3fejdde","datePublished":"2026-09-29T06:53:30.251Z","dateModified":"2026-09-29T06:53:30.254Z","author":{"@type":"Person","name":"Ted K","url":"https://daily.dev/ejboy","image":"https://media.daily.dev/image/upload/s--PzSRqJKu--/f_auto/v1787843390/avatars/avatar_Szw3t3q8eJYj5aTperuyF?_a=BAMAMicg0","description":"Building lightweight developer tools at PVR Labs.","interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"EndorseAction"},"userInteractionCount":2180}},"image":"https://media.daily.dev/image/upload/s--1KxV4ohY--/f_auto/v1722860400/public/Placeholder%2007","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":32},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":8}],"sharedContent":{"@type":"WebPage","url":"https://api.daily.dev/r/w4Qvp2wFQ"},"comment":[{"@type":"Comment","text":"i always use jdbctemplate in my projects are much faster than jpa.","datePublished":"2026-09-29T18:13:31.116Z","url":"https://daily.dev/posts/pj3FeJDDe#c-IXJIWkkvl","author":{"@type":"Person","name":"Miguel Squillari","url":"https://daily.dev/miguelsquillari","image":"https://lh3.googleusercontent.com/a/ACg8ocLimJng9owmG6LsfT9jqziYS4vxsicbhJRqI05UggYDHxqC_ff3=s96-c"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":3}},{"@type":"Comment","text":"For a small service, JdbcTemplate can just get on with it. Hibernate can stay in the cupboard.","datePublished":"2026-09-30T11:06:12.317Z","url":"https://daily.dev/posts/pj3FeJDDe#c-s1Q9mWRdD","author":{"@type":"Person","name":"Risto Tõldsep","url":"https://daily.dev/ristotoldsep","image":"https://media.daily.dev/image/upload/s--i6RRoxB7--/f_auto,pg_1/v1794383659/avatars/avatar_ryDlbifZ1EuRuh3g51ryC?_a=BAMAMiiw0"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":2}},{"@type":"Comment","text":"Checking the three fixture counts and JVM metrics establishes that both dashboards work, but it does not yet establish equivalent persistence behavior. Before treating the cheaper variant as a replacement, I would add a failure during a multi-statement refresh and a concurrent-update case, then verify rollback and the resulting database state in both applications.\nThat matters because the JDBC version moves behavior previously supplied by repositories and transactions into its own service code. Your explicit complete-variant limitation is useful here: the footprint advantage can be real while part of the application contract still needs comparison. Reporting query counts and transaction boundaries alongside the existing fixture assertions would make the tradeoff easier to reproduce.","datePublished":"2026-10-06T18:34:57.460Z","url":"https://daily.dev/posts/pj3FeJDDe#c-52dWDVULD","author":{"@type":"Person","name":"Ahmet Özel","url":"https://daily.dev/ahmetozel","image":"https://avatars.githubusercontent.com/u/70992231?v=4"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1}}],"isPartOf":{"@type":"WebPage","url":"https://daily.dev/squads/justjava","name":"Just Java"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Just Java","item":"https://daily.dev/squads/justjava"},{"@type":"ListItem","position":3,"name":"Spring Boot JPA vs JDBC"}]}
```

