Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

Go Back  dBforums > General > Database Concepts & Design > Database Design question

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-27-03, 20:26
sbaru sbaru is offline
Registered User
 
Join Date: Jun 2003
Location: Ohio
Posts: 148
Database Design question

We have a situation where there are 4 different applications that share some common data like (customer, units etc). My idea was to create seperate databases for each of these applications and then one common database that holds all the common information. (We are using SQL Server 2000). The problem with this approach is that I cannot create referrential integrity across databases. The other option is to replicate the common data in all the databases.
If there is a way out, I would want to implement the common database approach. So was looking for some suggestions here.

Any ideas are greatly appreciated
Reply With Quote
  #2 (permalink)  
Old 06-28-03, 14:38
ss5416 ss5416 is offline
Registered User
 
Join Date: Jun 2003
Location: St. Louis, MO USA
Posts: 8
Re: Database Design question

Have you considered an OLAP DB to data mart the multi-application data? Sounds like a prime chance to try that out.

Still wouldn't solve the referential integrity part. Almost think that would require an external business layer to manage it.

Perhaps you could build your own constraints on INSERT, UPDATE, and DELETE to manage the external DB's. Afterall, RI is just natural constraints defined on related tables. Nothing says you can't build your own. Except maybe you DBMS's ability to support constraints.

Hmm...That would be how I would approach it but leave it to this community to explain any theory on the topic.
__________________
Shawn V. Schwartz
Reply With Quote
  #3 (permalink)  
Old 06-28-03, 14:41
ss5416 ss5416 is offline
Registered User
 
Join Date: Jun 2003
Location: St. Louis, MO USA
Posts: 8
Better yet, if you have the ability to pull those common tables out, customers is a prime one, into its own DB, you'd be set. That way you are not duplicating data in multiple applications. They would just be fed from one source. Guess you have to weigh the administrative considerations from cross DB joins.

Of course you still have the RI issue. For instance, if you want to cascade a delete, you would still need the custom constraint to manipulate the external DBs.

Sorry for rambling through your discussion. Brainstorming, I suppose.
__________________
Shawn V. Schwartz

Last edited by ss5416 : 06-28-03 at 14:46.
Reply With Quote
  #4 (permalink)  
Old 06-30-03, 20:32
sbaru sbaru is offline
Registered User
 
Join Date: Jun 2003
Location: Ohio
Posts: 148
thanks for your time. I am not very much worried about cross DB joins, because there will be no difference in performance. And yes, my thought is to put all the common tables (like customer) in a common database. The issue comes when, let us say there is a SP in one of the application databases that queries a customer record in the common database, it finds it and then tries to insert a child record for that customer. Between the first select and the subsequent insert, the customer record in the common database is deleted, what would happen? This is one of the situations I could think of. Am looking for issues like this and the best way to handle them. One way I could think of, is to create a customer table in every database that just has only the customer ids and tie the RI to all the child tables in that database. In the main database, I should have triggers on the customer table that will replicate the change onto the customer tables in the application databases. Not sure if I am clear, but do you see where I am going?
Reply With Quote
  #5 (permalink)  
Old 07-02-03, 11:27
AdemMeral AdemMeral is offline
Registered User
 
Join Date: Jul 2003
Posts: 4
U can link the tables in sql server 2000 and enforce referencial integrity that way. Just my $ .02.
__________________
The life is racing, the rest is waiting.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On