Issue
I am currently working on a project built using the spring framework. We are using stored procedures instead of Hibernate queries What are the advantages of using Stored procedures instead of using either Hibernate methods or queries in DAO classes?
Solution
Depending on what you are doing in the stored procedures, it might be better latency-wise to use stored procedures to avoid network round trips for successive database calls. I don't know if MariaDB supports this, but I think some databases support pre-compiling stored procedures to reduce the latency even further.
Having said that, if you use the advanced SQL features of your database (recursive CTEs, window functions, anonymous blocks), you should be able to get a very similar performance. IMO it only makes sense to use stored procedures if they are called by multiple applications that can't share code.
Answered By - Christian Beikov
Answer Checked By - David Marino (JavaFixing Volunteer)