Dude, Where is my Application Logic?

Being a DBA means you work with all kinds of applications.

Some applications do everything in Java. The application runs on huge application servers but connect to a DB they share with many other similar applications, and even then the load on the DB is not too high.
Other applications do everything in the DB. The application server is a tiny little vmware guest, sharing a physical host with many other similar applications. The DB is a multi-node RAC that is constantly using 100% CPU.

Which is better? Application developers are not interested in the debate. They know everything should be done in Java and the DB is just a random place where bits are kept.

you’d think that most DBAs would support putting most of the data processing logic in the DB. At the very least follow Steven Feuerstein’s advice and avoid putting queries in the code and wrap them in functions that represent the business logic of the queries. That is, forget about select sal from emp where ename=’Chen’ and use getEmpSalary(‘Chen’) instead.
You’d think that DBAs will know that Oracle is very very good at processing data. Much better than you can make your Java application.

I was very surprised to hear that some DBAs disagree with me. I’ve heard two reasons for it:
1. It is difficult to find skilled PL/SQL developers.
2. Business logic belongs in the application.

The second argument is a bit cyclic and is probably the result of a poor DBA who got brainwashed by the developers.

The first one is worth some thinking. I agree that there are more Java developers than PL/SQL developers. On the other hand, if they are indeed skilled and professional developers, they will quickly see the benefits of putting data processing in the DB and do the right thing. No?

I’ve added few excellent blogs to my reading list recently. Maybe you’ll like them too:

  • Oracle at Work – Lots of good advice. And this guy seems to work on exactly the same stuff that I do , so his advice is extra useful. If he didn’t give his name on the blog, I’d probably suspect that the blog is written by the senior DBA in the next cube.
  • Richard Foote – I loved his unconference sessions about index internals, and I find his blog a bit addictive. Excellent advice about indexes, with in depth explanations and proofs. What more can a girl want?
  • OptimalDBA – This guy is obviously very experienced. The blog is a combination of things that are good to know and very depressing insights about our lovely industry.
  • MosheZ – MosheZ is not a DBA. His blog is an interesting mix of technical articles, parkour training and social commentary. I like the geekiness of everything he writes.

4 Comments on “Dude, Where is my Application Logic?”

  1. Sidhu says:


    ….them in functions that represent the business [b]login[/b] of the queries….

    I guess it has to be [logic] 🙂


  2. prodlife says:

    Thanks Sidhu. Fixed it 🙂
    I actually had this typo several times in the post, but I thought I caught all of them before publishing. My fingers insist on typing what they are used to, instead of what I mean.

  3. Don Seiler says:

    One more argument that people make is that they want the application to be db-neutral. But then they never bother with any other databases. Of course, if you’re paying all that money for Oracle, there’s nothing neutral about it. That’s like tithing $100,000 a year to the Vatican and saying you’re agnostic.

  4. prodlife says:


    Thats an excellent point.
    The applications that do everything in Java were indeed built to be DB-neutral, or built for MSSQL and then converted to Oracle, or simply have one DBA for every 500 developers.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s