
May 20th, 2004, 07:01 AM
|
|
Registered User
|
|
Join Date: Sep 2003
Location: Qatar
Posts: 3
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
PRIMARY KEY conflicts in DISTRIBUTED DATABASE Design
Scenario:
I have currently single database for managing my ORDERs. ADMIN and CLIENTs both connect to the same database.
My future approach is that I am going to distribute the databases or I should say separate the databases for ADMIN and ORDER.... Clients will place order in ORDER DB and ADMIN will play at ADMIN DB which both will lie on separate servers.... Furthermore, i am going to distribute my ADMIN DB into 3 separate DBs for each of my UNIVERSITY, clearing that my orders are specific to the UNIVERSITY....
Hence in the end i have 3 UNIVERSITY ADMIN DATABASES, which will have all the objects in common, like horizontal partitioning of data.... Problem is that I can't rely on PRIMARY KEY RANGES for values like ORDER ID ( 1 to 1000) in DB 1 and (1001 to 2000) in DB 2 and so on... I need an efficient solution as compared to this, that makes sure that any record inserted in any database for the same entity must have a unique PRIMARY KEY ....
One solution that I have figured out uptil now is that i can keep a compound PRIMARY KEY, which would have UNIVERSITY CODE in every table, which will have a different and fixed value for each SERVER. and leave the rest IDENTITY columns repeating in all the servers.... This solution will cause some major change in my pages and procedures for integrating the new university code field, currently there are only IDENTITY PRIMARY KEYs for each table, i want the solution that will save my alterations to pages and procedures or at a minimum level.
Does anyone have a better solution, Thanks in advance ...
Last edited by FaisalHabib : May 20th, 2004 at 07:04 AM.
|