There are several unit testing frameworks for PL/SQL. Code in the database encapsulates business logic, it gives you unified access from all clients. It can also be orders of magnitude faster. The presentation linked here
https://thehelsinkideclaration.blogspot.co.at/2016/09/noplsq...
proves that with flame graphs for a simple workload done from the app server vs. implemented in PL/SQL.
Re:Oracle’s Cloud Licensing Change
by tannhaeuser on Sunday January 29, 2017 @04:31PM
(#13516816)
The performance argument I can accept (I've done PL/SQL coding and administered Oracle clusters years ago). But when it comes down to it, PL/SQL can possibly only benefit from lower inter-process or JDBC driver overhead vs. Java, say. I've seen PL/SQL becoming a CPU bottleneck in large real-time migration projects.
To encapsulate business logic using PL/SQL, however, is crazy IMHO. Rather than coding your business logic in a mainstream language (with incomparably better staffing and tooling), you now have it in a proprietary niche language with awkward or even non-existent debugging.
Also, the relational model is (or should be) the unified access at this level IMHO, rather than some ad-hoc data access layer.
I've heard that "in the database" sentence many times but never got it. PL/SQL is just another programming language VM that happens to have SQL types as native types, and syntax for SQL cursors.
Other than for triggers and possibly indexed deterministic functions (both of which are inessential/questionable), you don't want your code "in the database" due to it lacking basic capabilities such as unit testing.