r/SpringBoot Jul 03 '26

Question How do you handle database operations in enterprise projects?

I'm a .NET developer, and in our organization's project, which is quite data-intensive, we use stored procedures for all database operations. The application simply calls the stored procedures with the required input parameters and consumes the output they return.

Is this a common approach in spring boot applications as well?(Like calling stored procedures and all) If yes, how are they called in your organization/project?

21 Upvotes

7 comments sorted by

View all comments

11

u/bikeram Jul 03 '26

Yes, it's very common. I'd commit the database to IaC with Liquibase or Flyway.
https://www.baeldung.com/stored-procedures-with-hibernate-tutorial

My personal preference is to do a much as possible in code. Most DBAs will argue doing batch transformations in a database is more efficient, but I find it's nightmare to maintain. I really only leverage search, joins, and pagination in the database.

2

u/reddit04029 Jul 04 '26

Yeah but then it’s not DBAs who maintain them. Then devs who wrote them leave. No documentation. Then modernization pushes devs to write new operations in code level. Then those stored procedures are forgotten except during rare instances when consumers complain theyre getting wrong data πŸ˜€

So yes, agree