SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Decoupling in Relational Databases


Decoupling in Relational Databases

Author
Message
timclaason
timclaason
SSC Veteran
SSC Veteran (224 reputation)SSC Veteran (224 reputation)SSC Veteran (224 reputation)SSC Veteran (224 reputation)SSC Veteran (224 reputation)SSC Veteran (224 reputation)SSC Veteran (224 reputation)SSC Veteran (224 reputation)

Group: General Forum Members
Points: 224 Visits: 143
Comments posted to this topic are about the item Decoupling in Relational Databases
Martin Widmer
Martin Widmer
Forum Newbie
Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)

Group: General Forum Members
Points: 3 Visits: 19
The article is of course correct but 'decoupling databases' is not what it is about. What you describe is the very basics of database design. And the tabels are relation tables, not bridge tables... So nothing is being decoupled here, just properly designed.
james.prendergast
james.prendergast
Forum Newbie
Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)

Group: General Forum Members
Points: 5 Visits: 20
I have to agree that this article is both mis-named and really a no-brainer. Just good design practice. There is really no simpler way of implementing many-to-many relationships in relational databases
Gary Varga
Gary Varga
SSC-Dedicated
SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)

Group: General Forum Members
Points: 38086 Visits: 6562
My understanding is that in this standard relational database design pattern (as highlighted by the previous posters) and what the article refers to as a 'bridge table' is commonly referred to as a 'link table'.

Gaz

-- Stop your grinnin' and drop your linen...they're everywhere!!!
sqlusers
sqlusers
Ten Centuries
Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)

Group: General Forum Members
Points: 1069 Visits: 512
Hi Timothy,

Normalization and decoupling are one and the same?
Gary Varga
Gary Varga
SSC-Dedicated
SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)

Group: General Forum Members
Points: 38086 Visits: 6562
sqlusers (3/2/2010)
Hi Timothy,

Normalization and decoupling are one and the same?


Just to butt in, I would say that normalisation is the standard way of decoupling data in a relational database.

Gaz

-- Stop your grinnin' and drop your linen...they're everywhere!!!
bill.sugden
bill.sugden
SSC-Enthusiastic
SSC-Enthusiastic (145 reputation)SSC-Enthusiastic (145 reputation)SSC-Enthusiastic (145 reputation)SSC-Enthusiastic (145 reputation)SSC-Enthusiastic (145 reputation)SSC-Enthusiastic (145 reputation)SSC-Enthusiastic (145 reputation)SSC-Enthusiastic (145 reputation)

Group: General Forum Members
Points: 145 Visits: 144
Give the guy a break - this is aimed at newbies.

Right - it is a no-brainer for us grizzled database developers. I can add a little constructive criticism though Tim. Your link table has an IDENTITY column - why? If you create a composite key of your fk_user + fk_group columns (check out your naming as well) and set this as the PRIMARY KEY to this link table you are killing a couple of birds with one stone.

(1) You have eliminated a redundant column
(2) You have ensured that you are not duplicating USER-GROUP membership (PK uniqueness)
(3) You can either eliminate your duplicate checking SQL and let the UI layer deal with an error, or simplify your checking to ignore the error completely

Bill
Gary Varga
Gary Varga
SSC-Dedicated
SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)SSC-Dedicated (38K reputation)

Group: General Forum Members
Points: 38086 Visits: 6562
bill.sugden (3/2/2010)
Give the guy a break - this is aimed at newbies.

Right - it is a no-brainer for us grizzled database developers. I can add a little constructive criticism though Tim. Your link table has an IDENTITY column - why? If you create a composite key of your fk_user + fk_group columns (check out your naming as well) and set this as the PRIMARY KEY to this link table you are killing a couple of birds with one stone.

(1) You have eliminated a redundant column
(2) You have ensured that you are not duplicating USER-GROUP membership (PK uniqueness)
(3) You can either eliminate your duplicate checking SQL and let the UI layer deal with an error, or simplify your checking to ignore the error completely

Bill


Bill,

I will say that I feel that most of the comments are constructive criticisms. Particularly as this is aimed at the more novice practitioner, we need to ensure the accuracy of the article. Personally, I don't think that terms such as 'no brainer' and 'newbies' helps but some people find them helpful descriptives. Interestingly, there is a recent thread discussing how to inform authors or errors, mistakes and corrections ([url=http://www.sqlservercentral.com/Forums/Topic872452-263-1.aspx][/url]).

Regards,
Gary

Gaz

-- Stop your grinnin' and drop your linen...they're everywhere!!!
ALZDBA
ALZDBA
SSC Guru
SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)

Group: General Forum Members
Points: 52927 Visits: 9115
This is a good article that proves how normalization helps you design and maintain a database.

Johan


Dont drive faster than your guardian angel can fly ...
but keeping both feet on the ground wont get you anywhere w00t

- How to post Performance Problems
- How to post data/code to get the best help


- How to prevent a sore throat after hours of presenting ppt ?


press F1 for solution, press shift+F1 for urgent solution :-D


Need a bit of Powershell? How about this

Who am I ? Sometimes this is me Alien but most of the time this is me Hehe
Jonathan AC Roberts
Jonathan AC Roberts
SSCrazy
SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)

Group: General Forum Members
Points: 2730 Visits: 2034
It's not decoupling but designing for resolving many-to-many releationships.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum







































































































































































SQLServerCentral


Search