Re: Any reason not to have logic in the db?

  • From: Gints Plivna <gints.plivna@xxxxxxxxx>
  • To: linehanp@xxxxxx
  • Date: Tue, 12 Jun 2012 15:08:24 +0300

A while ago I wrote an article How to choose database
It isn't probably very directly relevant here, but it contains many
criteria apart from pure technical ones, for example, previous experience,
available resources, political decisions etc. In real life they are as much
important as technical decisions and sometimes even the decisive ones. We
for example are making apps for mostly governmental organizations and we
have both:
- a few apps where almost all business logic is in database (pl/sql and/or
- more recent ones where data are in DB but most of the logic in .NET.
One of the biggest reasons was that average pl/sql programmers are harder
to find than average .NET programmers, so we are succesfully maintaining
all cases.
And yes we have basic constraints, FK, PK in DB in all cases.

Of course one can find very technical and less technical discussions full
of flames about this topic, but the times when I thought that the ONLY DB
is Oracle, the ONLY VALID OPTION is to store all logic in db, the ONLY
RIGHT approach is to have surrogate keys etc semi-religious topics are far
gone and it is easier to live with sense that life (and software) is
diverse and there isn't only one RIGHT approach :)

Gints Plivna <>

2012/6/12 Paul Linehan <linehanp@xxxxxx>

> Hi all,
> Apart from my various meanderings as a DBA and
> programmer, I am also in College by night and thus
> want to get at the fundamentals of CS and databases.
> I don't profess to being an expert (I wish!), but I believe
> that I've grasped at least the rudiments of my field, i.e.
> databases and how they should be used.
> I've read loads (apart from my studies) of blogs and
> Oracle (which as we all know, has its flaws) books.
> What I want to know is: Is there any reason whatsoever
> to have logic outside the database that could potentially
> be kept there - notably CHECKs, CONSTRAINTs,
> TRIGGERs, containing possibly complex PL/SQL - i.e.,
> it's sort of a question about App-tiers vs. DB.
> My own opinion (to put my  cards on the table) is that
> "logic" should be stored as far down the stack as possible
> (DB, first, then app-server... &c).
> Anyone know of any counter-examples?
> TIA and rgs,
> Paul...
> --
> //


Other related posts: