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
2
u/avinasshh 18d ago
Another huge reason is when the database is the API and the app tier is just a disposable UI wrapper. if you have a legacy system or something like a core billing platform where clients are connecting from half a dozen different stacks (.NET, old PHP, node, random Go services), enforcing integrity and logic in stored procedures means you dont have to rewrite the same validation rules 5 times across 5 different codebases. its ugly to debug, but its the only way some architectures dont turn into complete chaos.