r/SQL • • 17d ago

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

/r/FullStack/comments/1xrsx3f/why_implement_procedural_programming_inside_an/
10 Upvotes

7 comments sorted by

View all comments

2

u/jshine13371 17d ago

One other minor reason not mentioned yet is the database layer is more centric than the app layer. Putting the business logic (when appropriate) there makes it a single place the logic needs to be maintained but will apply to all consumers in the app layer and reporting layer. 

Prevalence of APIs have helped minimize that issue, but still can't be consumed in all places where the data is, e.g. many reporting consumers. So applying your business rules in the database is a lower part of the stack that's applicable everywhere.