[ic] MYSQL/IC: Connecting to a second database

Orko interchange-users@interchange.redhat.com
Tue Feb 26 14:22:00 2002


Annotated below.

On Tue, 2002-02-26 at 10:34, Dan Browning wrote:
> At 11:58 AM 2/26/2002 -0600, you wrote:
> >Problem:  Need to connect to a second database within IC pages.
> >
> >I've been searching through the documentation and seen some related 
> >messages, but nothing exactly on this topic.  We need to connect to a 
> >second database within IC.  To explain further, we have a corporate master 
> >products database (mpd).  Currently, we have to get a feed of products 
> >from this database, and then import it into our IC MYSQL database.  We 
> >would like to just make queries directly on the mpd and then  continue to 
> >use our MYSQL database for everything else.  (We need to eliminate the feed.)
> >
> >For example, within the flypage.html, how would we do this? Or would we 
> >have to set up a global sub and call it from the page?  I've seen things 
> >such as:  dbi:mysql:database_name;host=111.111.111.111 --
> >
> >I need a shove here.  Thanks
> >
> >Michelle
> 
> It is part of the default feature set (and one of the coolest things about 
> IC, IMHO).  Just change the relative dbconf/ files (manually typing in the 
> dbi, or setting a second Variable to substitute).  That is one reason why 
> "table" and "database" are semi-synonymous in IC.


What about writing to two MySQL DB's, like adding a backup mirror MySQL
DB, for every DB write?  Is there a central way of always mirroring DB
writes (not selects, of course :) ) into another DB?  I would readily
sacrifice the small loss in speed for the redundancy.

Is this just a matter of adding more dbconf files for the mirror DB
tables, then adding in a second import to all of the pages/routes that
do imports?  I'm thinking not, since there are several other ways to
write to the fields in the main DB...

Or would it be better to modify the DBI.pm module to do the second SQL
write statement when *any* write is detected?

-- orko

 
> 
> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> | Dan Browning, Sr. Tech Consultant
> | Kavod Technologies, 1498 SE Tech Center Pl Ste 170
> | Vancouver, WA 98683  <dan.browning@kavod.com>
> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Anthony's Law of Force:
>          Don't force it; get a larger hammer.
> 
> _______________________________________________
> interchange-users mailing list
> interchange-users@interchange.redhat.com
> http://interchange.redhat.com/mailman/listinfo/interchange-users
> 
> 
> 
> 
> 
> 
> 
-- 
Office: (360)697-1603
  Cell: (360)271-0796