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

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


On Tue, Feb 26, 2002 at 11:58:31AM -0600, Michelle Wilant 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


We're just wrapping up a similar project, only the remote database
is DB2.  I'd been intending to write it up figuring it might help
someone else.  This is just a summary:

Given that the turnaround time to DB2 was relatively long and that
access would sometimes be interrupted, we opted to use a background
process to pull data from it into the local catalog db server for
the overwhelming bulk of the data.

We do still make some live queries for real time cc processing and
order placement.

To handle both the live and the background processes, we've written a 
standalone daemon to which catalog talks.  The daemon maintains a 
persistent, encrypted, connection to the mother db via internet
to corporate firewall to a dmz machine running dbiproxy.  It 
works a lot more reliably than we had expected.

Both catalog and background processes talk to daemon with FreezeThaw
and it returns data same way.  See the Advanced Perl Programming 
book for great examples.  One can ask it for inventory of one 
item or all, place orders and so forth.  Anything the catalog can 
do, command line can do; that **really** helps with debugging.

ic  <-->
         daemon/dbiproxy <--> firewall <--> dmz/dbiproxy <--> db2
cli <-->

Timeouts and recovering gracefully from failures are big issues;
pay attention to them.





> 
> Michelle
> 
> _______________________________________________
> interchange-users mailing list
> interchange-users@interchange.redhat.com
> http://interchange.redhat.com/mailman/listinfo/interchange-users

-- 

Christopher F. Miller, Publisher                               cfm@maine.com
MaineStreet Communications, Inc           208 Portland Road, Gray, ME  04039
1.207.657.5078                                         http://www.maine.com/
Content/site management, online commerce, internet integration, Debian linux