Forum Moderators: open

Message Too Old, No Replies

2 domains 1 db ASP

sharing a database

         

click watcher

11:10 pm on Mar 6, 2002 (gmt 0)



the scenario.

2 seperate domains, the primary one has the database and is the "master site" the secondary domain is located elsewhere, this second site sells 70 items that are in the masterdatabase. this database is updated about 2 times a week, what varies is the price of items and the availability (yes/no)
the prices and availability must match on both sites.
on the secondary domain/website the informations needs only be read from a database there is no requirement to write to this db, it needs to write only to the shopping cart db which is seperate.
Windows host, access database, asp scripting.
the domains are on seperate servers

the fantasy solution

the masterdatabase is updated in the normal way, i then run a script (with this host i have the ability to schedule tasks at a specific time) which
a) draws the required data from the db (about 70 records - 5 fields each) and writes it to a text file, posts the text file to the secondary domain(webserver) which replaces the previous text file, i will have set up the secondary domain to draw its data from this text file (flat database)

b) as above but run a query on first database make a table with the result, post the table to the secondary domain, replace the table in the secondary domain database with the new table (with the updated availability and prices)

the question.

is a) or b) above a possible/sensible solution ...
the masterdatabase is adjusted manually and this is ok,
but i'd like the updating of the second domain to be automated.

any other ideas?

or should i just stop drinking too much coffee and be more grounded with my needs??

thnx

justa

4:46 am on Mar 7, 2002 (gmt 0)

10+ Year Member



Can't you Query the database from the other domain? That way it could be done when ever the customer is searching your site and get the most up to date information.

I use ColdFusion, and although I haven't tried this before I imagine (I do have a big imagination though) that this would work.

<cfquery name="records" datasource="MasterDatabase" maxrows=70 dbtype="ODBC" username="MasterDatabaseID" password="MasterDatabasePassword" dbserver="DatabaseServerName" dbname="DatabaseName" provider="IP'sName" providerdsn="IP'sDSN">
SELECT what_I_need
FROM tables_required_from
WHERE 0=0
ORDER BY whatever
</cfquery>

I'm not sure how this will affect the speed of either site, or the bandwidth. The other option is to set up a schedule on domain 2 to get the information from masterdatabase, that seems to be easier then the master sending the information.

txbakers

1:16 pm on Mar 7, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you are using an ODBC connection to the DB it doesn't matter where it resides.

You can query it at any time from anywhere.

click watcher

4:53 pm on Mar 7, 2002 (gmt 0)



thanks for the input guys much appreciated

>>>Can't you Query the database from the other domain?

seems you were right justa

>>>You can query it at any time from anywhere.

wow, i had no idea this was true, it opens up a whole new area of possibilities for me, thanks a lot.
<<warm glow of a little more ignorance lifting>>

but presumably there is a price to pay in terms of speed???

txbakers

5:49 pm on Mar 7, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



ODBC in general is a slower connection than a direct connection to a DB. Oracle and Sybase, et al have direct connection DLLs. ODBC is a slower pipe.

But unless you are getting into millions of records you shouldn't see a problem. I've connected from my office in Dallas to a DB in Calgary, Alberta, Canada via ODBC without performance issues.