How much of data constraints on database is enough?

From: "Miho Ishikura" <mihoishikura(at)gmail(dot)com>
To: sfpug(at)postgresql(dot)org
Subject: How much of data constraints on database is enough?
Date: 2008-01-16 06:07:12
Message-ID: d411d180801152207r4a1b535btcb88f9c48dfe0f0@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: sfpug

Hi people!

I have a question that I'm always not clear about.

Let's say there is an application that talks to PostgreSQL database.
And you want to add constraints around it. Constraints contains
validations, business logic, data integrity.

I have worked on the applications that was very database driven
before. We had a lot of constraints like foreign keys, unique keys,
check constraints, triggers, functions... etc. It was very rich and
quite fun. I would love to do that again if I have a chance. I
understand that it can be done and SQL on Rails is no joke (!).

Being said that, you also have choice to do the same in your
application as well. Why do you want to have them in 2 places? Maybe
some constraints are appropriate to be done in application, some
should be on database. But where do you draw the line? Might as well
do them all in application!?

What do you think?

Miho

Responses

Browse sfpug by date

  From Date Subject
Next Message Chris Mungall 2008-01-16 06:24:37 Re: How much of data constraints on database is enough?
Previous Message Josh Berkus 2008-01-16 02:45:46 Re: [sfpug] PostgreSQL + Java devlopers wanted for JavaOne