r/FullStack • u/tillas_ • 18d 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!
View all comments
7
u/Leverkaas2516 18d ago edited 18d ago
I worked in a large team once where the devs would tell the DBAs what they were planning and the DBAs would guide the table design and also provide stored procedures as a sort of data access API. The DBAs had freedom to rearrange the structure of the data and devs almost never wrote SQL directly. There was less coupling between the application code and the data, which was generally a good thing.
It worked surprisingly well. There were some downsides in organizational efficiency, but what I've come to learn is that developers tend to be shortsighted when they're doing data design. We're more focused on expediency.