r/FullStack • • 17d 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!

16 Upvotes

41 comments sorted by

View all comments

Show parent comment

1

u/tim128 16d ago

You always have at least two: the application program, and the dbms command-line interface.

Okay? Your CLI isn't tied to the schema. Do you even understand why is a bad idea to have multiple applications accessing the same db? Putting business logic in stored procedures is a horrible decision to fix the outcome of another horrible decision.

1

u/AdministrativeHost15 16d ago

Its a legacy of when servers and disk space was very expensive so the database needed to be shared as much as possible. Database developers were the senior protectors of the company's property. Application developers were just kids playing with HTML and JavaScript who couldn't be trusted to touch the data without going through a stored proc.