Of Interest To Oracle and Java Developers

Robert Vollman touches on one of the age-old debates in Oracle database development – where should the business logic reside? Oracle developers, and especially Oracle DBAs, tend to want as much of an application as possible living within the database. Java developers tend to want the logic in the application code. Apart from the strict technical considerations (code efficiency and capability), I can think of three issues that might affect the decision.


  • Portability, or to use an old term from the 90s, platform-independence: assuming you are wedded to Oracle as your database platform, then capturing the business logic in stored procedures (either PL/SQL or Java) minimizes the functionality of the front-end application, making a front-end rewrite of the application a less threatening possibility.

  • Reuse. It’s not uncommon to have a mix of client-server, web-client, and reporting-tool applications all hitting the same database. If your logic is maintained in the application layer, then parts of the application logic have to be reproduced in potentially all three front-ends. Sharing stored procedures can greatly reduce this duplication of logic.

  • Maintenance: who will be maintaining your application, and how available are the skillsets? If the front-end is written by a consultant team, for a database supported by your in-house staff, then it makes sense to stack as much of the business logic as possible in the domain known and supported by your in-house staff – the database itself. You don’t want to have to start writing new contracts every time something needs to be tweaked. If it the application is completely written and supported in-house, the equation can change.

So I suppose there’s no correct answer. As a DBA, I tend to lean towards using the capabilities of the database to the utmost, which means capturing the business rules in stored procedures. It’s not as much fun for the Java guys, or the C# guys, but making them happy isn’t in my job description.

January 19, 2006 В· Harry В· Comments Closed
Posted in: Geek Stuff