Re: Multiple specification of constraints

From: ben brugman <ben_at_niethier.nl>
Date: Thu, 26 Feb 2004 18:14:27 +0100
Message-ID: <403e2973$0$1416$4d4ebb8e_at_read.news.nl.uu.net>


I agree with most that is allready replied. Constraints should be centralised. But the problem is often where and how.

Constraints which can be enforced in the RDBMS system should be enforced there. (If the constraint is not to complex).

Then most applications (server or client) will enforce a constraint again, because the application does not like the exception handling when a constraint of the database goes 'off'. For the GUI it is a lot handier to remark there is no data the 30th of februar (except in sweden) or that data is on a sunday and you can not use that date, than to do the database access and get an error. So most programmers doing the data access still have to know the constraints to anticipate on them, same goes for the Gui programmers. (I hate web applications which first ask all the questions and in the end tell me that I am not allowed to do something because of .....)

Then there are constraints which are more difficult or impossible to implement in the RDBMS, and although the constraints should be 'kept' centralised. These have to be enforced outside the RDBMS. (Some database people say that if a constraint can not be implemented in a database, then it can not be a real constraint. I do not agree with that.)

The advantage of enforcing the constraints in the RDBMS over another centralised system is that it also protects against concurrency and that it is often better scalable than a 'coding' solution.

> I forget who wrote up the story of a major retail chain that built a new
> store in a certain zip code because their data said a lot of people go
from
> that zip to another to go to this chain.

Looks like Urban legend to me.

But I know that there is a similar story. A retail chain did not have a outlet
in a more posh area, because surveys had shown people in that area would not buy there. But from that area people did use the retail store in other area's because they where not recognised there. This the retail knew from payment information. (The area and the retail store are both know by me).

ben brugman Received on Thu Feb 26 2004 - 18:14:27 CET

Original text of this message