Transferring rows between 2 databases on 2 web servers

Transferring rows between 2 databases on 2 web servers

am 18.01.2010 07:23:04 von Ferdi

--0016e644c6ecccabab047d6a6217
Content-Type: text/plain; charset=ISO-8859-1

Hi Everybody,

There are n number of web servers all having the same Linux-Apache-MySQL-Php
setup, with identical databases. Each of these servers functions as a
billing server at a store of my company. Now I am required to set up a
master server that will copy all data from each of the store servers. All I
wish to know is:

How can a page on the master server obtain data from a store database by
calling a page located on the store server?

I do not wish to access a store database directly, but through a page on the
store server. Specifically, how can a web page get data from another web
page on another server.

Many thanks,
Ferdi

--0016e644c6ecccabab047d6a6217--

Re: Transferring rows between 2 databases on 2 web servers

am 18.01.2010 07:34:20 von Karl DeSaulniers

--Apple-Mail-6--126064785
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
charset=US-ASCII;
delsp=yes;
format=flowed

I would create a PHP file that is stored on each server that you call
from your master server.
In that file that is stored on each server, write the code that
retrieves your data and get/send the response.

Karl

On Jan 18, 2010, at 12:23 AM, Ferdi wrote:

> Hi Everybody,
>
> There are n number of web servers all having the same Linux-Apache-
> MySQL-Php
> setup, with identical databases. Each of these servers functions as a
> billing server at a store of my company. Now I am required to set up a
> master server that will copy all data from each of the store
> servers. All I
> wish to know is:
>
> How can a page on the master server obtain data from a store
> database by
> calling a page located on the store server?
>
> I do not wish to access a store database directly, but through a
> page on the
> store server. Specifically, how can a web page get data from
> another web
> page on another server.
>
> Many thanks,
> Ferdi

Karl DeSaulniers
Design Drumm
http://designdrumm.com


--Apple-Mail-6--126064785--

Re: Transferring rows between 2 databases on 2 web servers

am 18.01.2010 07:35:53 von dmagick

Ferdi wrote:
> Hi Everybody,
>
> There are n number of web servers all having the same Linux-Apache-MySQL-Php
> setup, with identical databases. Each of these servers functions as a
> billing server at a store of my company. Now I am required to set up a
> master server that will copy all data from each of the store servers. All I
> wish to know is:
>
> How can a page on the master server obtain data from a store database by
> calling a page located on the store server?
>
> I do not wish to access a store database directly, but through a page on the
> store server. Specifically, how can a web page get data from another web
> page on another server.

wget (from linux command line)
curl (from linux command line or using the php curl functions)
file_get_contents (php function)
fopen (php function)

There are a number of ways but you'll most likely run into timeout issues.

I think you are much better off writing a script that does it
command-line and connects to the remote database and pulls the data
back. Then if the script takes an hour to run you won't have any
problems - you definitely will if you do it through a web page.

I'd also say security would be easier to implement via direct database
access (firewalls, mysql user limits, ssl-only connections).

--
Postgresql & php tutorials
http://www.designmagick.com/


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php