Concurrency, was Re: Doh! Stupid Programming Mistakes <humor>

Bryan Sant bryan.sant at gmail.com
Fri Oct 27 16:41:56 MDT 2006


On 10/27/06, Michael L Torrie <torriem at chem.byu.edu> wrote:
> There are many advantages and disadvantages of pushing logic into the
> database engine. The biggest advantage is that the Java (or PHP or Ruby)
> is just another front-end to your app.  Having a nice database design
> with triggers, constraint enforcement, and stored procedures, allows you
> to easy have a web-based front-end, or a standalone gui front-end,
> command-line interface, or even a remote telnet curses interface.
>
> Of course web services do have the same effect in my opinion.

Spoken like a true DBA.  To play the devil's advocate, I would say
that the database is a system... that... holds... DATA.  It is a
persistence mechanism, and shouldn't be used for anything more than
that.  What you're proposing (and I'm not disagreeing with you, just
pointing out the alternative), is that the database is central to the
system -- up to and including business logic.  I would argue that the
database is a horrible place to put business logic, and that all
business logic belongs in the Java server application.  Thus the JEE
server becomes the back-end that all future front-end systems
integrate with (web-based, gui, command-line, or curses).  Now I have
a much, much, much richer place to hold sophisticated business logic
compared to the database.  And I've abstracted away the underlying
persistence mechanism (the database), so now I can move to any
database I want (I could start out with MySQL, move to Prostgres, and
then move to Oracle without rewriting a thing), or I could be using
SOAP calls to some other system for persistence, or I could be talking
to a mainframe, or I could just store stuff on the disc, or I could
... ...

The database is not sacred -- it's just one of many options for
storing data.  If you're super hip like me then you'll go for a
multi-tiered (aka n-tiered) system, where you have a front-end (web,
gui, cli, etc.), middle-tier (one or more JEE servers), and then some
dumb necessary-evil database in the back-end to store bits like a good
little girl.

-Bryan



More information about the PLUG mailing list