[ciapug] Best Practice

Tim Perdue ciapug@cialug.org
Mon, 24 Jan 2005 10:51:49 -0600


Dave J. Hala Jr. wrote:
> Yeah, I had been thinking about doing the "combining" via some scripts.
> I just was hoping for a real-time solution.
> 
> My guess is that scripts are probably the most reliable way to do it. I
> was just hoping to find a "real-time" solution.
> 
> I haven't quite decided what to do yet.
> 
> 
> On Mon, 2005-01-24 at 10:06, Claus wrote:
> 
>>On 1/22/2005 9:47 AM, Dave J. Hala Jr. wrote:
>>
>>>Ok... So...I've got this client intake system. Its written in PHP and it
>>>uses a mysql back end.  The information that is stored is demographic
>>>data on individuals and households.
>>>
>>>I have 9 agencies that use it. Each runs agency has their own website
>>>and database. (they are all identical)  What I would like to do is mine
>>>data across all 9 agencies.  At the moment, its kinda a pain to connect,
>>>and query each individual database and then combine all the information.

One thing you could do is set the auto-increment to, say, 10 for each of 
the databases. Then, you start each database at a separate number: 
database 1: the IDs start at 1, database 2: the IDs start at 2 and so 
on. With the auto-increment set to 10, each database will have unique 
IDs, so when you blend it back together in the master database, there 
are no conflicts and you can easily tell which DB the data came from 
originally.

That's probably the "best practice" for what you're doing.

Tim