r/FullStack • • 16d ago

Question Why implement procedural programming inside an RDBMS (MariaDB) instead of handling all business logic in backend application code?

So I have just seen the procedural programming language in the MariaDB RDBMS. So my question is, why in a relational database management system would you need SQL to also have the power of a programming language? Why in the layer of the database server would you need that? Can that be achieved with your backend server logic programming language, whether it be JavaScript, PHP, Python, Rust, Go, etc.? Why is there a programming language, why SQL is a programming language more so than just for querying and interacting with a database or databases? How does that fit into the full picture of full stack web development?

Edit: Thank you everyone for the thoughtful responses, technical insights, and feedback. All of this input is extremely helpful much appreciated!

17 Upvotes

41 comments sorted by

View all comments

Show parent comment

1

u/phil-99 11d ago

> Calculations are way more efficient in SQL rather than php, node, etc.

“Calculations” are not necessarily quicker in any system than any other.

Some operations on large data sets may be more efficiently handled in the DB than in an app that has to build a query execute a query get the results process the results and send the results back to the database.

But as always with a DBA answer: it depends.

And the details matter so much that making definitive statements like this shows a lack of expertise but an abundance of confidence.