spring-projects / spring-projects/spring-data-relational
Spring Data JDBC performance by caching SQL statements generated for derived queries.
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 827
- Forks
- 394
- PR merge metrics
- No merged PRs in 30d
Description
Hi
We have a Spring Data JPA (Hibernate) project that we would like to migrate to Spring Data JDBC.
The main reasons are simplified configuration and model mapping. And we thought that it would lead to better performance.
However we did some benchmarks (with default settings) using JMH (H2 database) and it turned out that in most cases the performance has decreased.
For example, we have the following repository and query method:
public interface ProductRepository
extends CrudRepository<Product, Integer> {
Product findByName(String name);
And the benchmarks showed the following execution time (in ns):
Spring Data JDBC - 80899
Spring Data JPA - 14124
So is it predictable? Or we missed something in our configuration/tests?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the ProductRepository findByName example and reproduce the JMH comparison between Spring Data JDBC and Spring Data JPA using H2. Investigate how derived-query SQL statements are generated and whether caching is involved. Done should mean explaining the performance difference or identifying a concrete configuration or implementation change, but the issue does not name source files or tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- backend, databases, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100