Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

sfpug by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group