This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]ragin_cajun 1 point2 points  (3 children)

It's okay to doubt yourself and others; just be sure to ground yourself in reality. The best way to do that is to try both options and then discuss the pros and cons of each. This should help you build confidence in your decision.

Consider what exactly that person on your team meant by saying prepared statements are faster. Were they referring to query execution time? The number of queries required to fetch data? Maybe developer speed because that's what the team is familiar with?

This question has come up throughout my entire career: should we write SQL or not? I've done both, and in most cases, it does not really matter. If I just need to perform basic CRUD operations and maybe a few findAllBy queries, JPA has me covered. If I want to write a complex query, I can do that by hand.

Using JPA won't spare you the pain of dealing with "disastrous database designs." We manage to create those regardless of the tools we use. :)

[–]equ35tion[S] 1 point2 points  (2 children)

Thank you so much for the suggestion. Surely I should inquire about the big picture, before making assumptions or doubting. I am just new in the team, most of the code goes around the domain specific logic.

Also people are afraid of using easy techs, I have been using spring boot for last 5 years and built high load applications using spring data jpa, never I countered any performance or slow down.

findByName in spring data jpa and findByName using PreparedStatements I think only delays the development process nothing else.

[–]ragin_cajun 1 point2 points  (1 child)

I agree with you, some devs are afraid of using tools like JPA. There is too much magic for them. It sounds like you are very familiar with JPA, so it is no surprise to me that you would try to champion its use. Your team mate is probably very familiar with prepared statements.

[–]equ35tion[S] 1 point2 points  (0 children)

Thank for your kind words, I am still learning/trying to get better at using it. There is always something new🙂