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/
11 Upvotes

7 comments sorted by

View all comments

1

u/RevolutionaryRush717 17d ago

Plenty of correct and to the point answers.

I'll throw in two very different motives from real life as a consultant in a big consultancy.

  1. Using Hibernate is a wonderful timesheet generator, because it allows junior Java devs do stuff that will eventually involve senior devs and actual DBAs to undo.
  2. Writing excessive stored procedures lets senior devs implement arbitrarily complex backend logic so that the thin veil of an interpreted programming language backend can be published as open source; only Real Programmers will be able to modify or undo any of this. This is what is called security.

For extra security, write self-modifying code. I think a colleague of mine did that in PL/SQL in stored procedures, as well as in Perl and a DSL in the application code.

Before AI, that was not easy to maneuver, even if you knew the domain, Perl and PL/SQL.

The self-modifying DSL part might even be AI-resistant, as the DSL is known by few people and the code is not on github.