Re: PG rules! (RULES being the word ;->)

From: Nils Zonneveld <nils(at)mbit(dot)nl>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: PG rules! (RULES being the word ;->)
Date: 2001-07-18 09:31:54
Message-ID: 3B555781.9E02AB36@mbit.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Janning Vygen wrote:
>
> But watch out the discussion "Application Design and PostgreSQL"
> these Days in the list. I thought your way. Thought it is pretty cool
> to have all logic inside the database, but it seems it isnt!
>
> How do you do your error checking?
> You won't be vendor independent!
> How do you check if your php sends a '1' instead of 'true' to the
> database. I think you can only catch this error with a midllerware.
> switching the databse is impossible.
>
> im just thinking about the same problem at this time and i am
> convinced by others to put the business logic in the middleware and
> just use SQL to store simple tables.
>

Putting business logic in the database doesn't mean you don't have to
check for bussiness rules in the middle tier. There are a few things
that a database can do without interference from the middle tier. For
instance I have a database where depending which client orders stuff
(flowers) and depending on the quantity, different percentages are
substracted from the price. All those percentages and conditions are
listed in tables, so PostgreSQL can handle that itself, you don't need a
middle tier for that. But integrity checks that raise an error need to
be handled in the middle tier. On first sight that looks like more work
to be done in the middle tier. On second sight though, its a guarantee
that it doesn't matter if you have 23 different middle ware programs or
just one large one, your data integrity will always be upheld by the
database itself. That doesn't mean you don't have to handle those
exceptions in the middle tier however.

Regards,

Nils Zonneveld
--
Alles van waarde is weerloos
Lucebert

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jan Wieck 2001-07-18 11:22:08 Re: undeleteable records
Previous Message Dr. Evil 2001-07-18 09:27:32 Re: PG rules! (RULES being the word ;->)