Thread: Distributed Database Web Site

Distributed Database Web Site

From
"Marc G. Fournier"
Date:
Just curious, how hard would it be to distinguish on the main web site
between read and write operations?

For instance, if we had a read-only database on a mirror site, replicated
from the main database using something like Slony ... how hard would it be
t have 'write operations' sent to the main web site to happen, with all
read operations being local?

ie. posting news events would happen at http://www.postgresql.org, but
reading news events would be @ http://www.xx.postgresql.org, but both
could/would be dynamic?

----
Marc G. Fournier           Hub.Org Networking Services (http://www.hub.org)
Email: scrappy@hub.org           Yahoo!: yscrappy              ICQ: 7615664

Re: Distributed Database Web Site

From
Justin Clift
Date:
Marc G. Fournier wrote:
 >
> Just curious, how hard would it be to distinguish on the main web site
> between read and write operations?
>
> For instance, if we had a read-only database on a mirror site,
> replicated from the main database using something like Slony ... how
> hard would it be t have 'write operations' sent to the main web site to
> happen, with all read operations being local?

Thinking about what it would take...

We'd need the pg_hba.conf of the main database set to allow connections
from the mirror website(s), so the write operations can occur.

Or, perhaps as an alternative, we could look at making the pages that
generate writes only be on the main PG website.  So, the majority of
content is mirrored except for a few pages which do stuff like (i.e.)
submit new stories and stuff.

I haven't really played with Slony in the scenario of multiple mirrors
that may or may not all be available at any one time, but Jan should be
able to give input here.


> ie. posting news events would happen at http://www.postgresql.org, but
> reading news events would be @ http://www.xx.postgresql.org, but both
> could/would be dynamic?

Yep, should be possible.  We just have to think about the technology
we'd like web mirrors to run, and then ensure it's acceptable and do-able.

:)

Regards and best wishes,

Justin Clift


> ----
> Marc G. Fournier           Hub.Org Networking Services (http://www.hub.org)
> Email: scrappy@hub.org           Yahoo!: yscrappy              ICQ: 7615664
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>    (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)


Re: Distributed Database Web Site

From
"Marc G. Fournier"
Date:
On Sun, 15 Aug 2004, Justin Clift wrote:

> Marc G. Fournier wrote:
>>
>> Just curious, how hard would it be to distinguish on the main web site
>> between read and write operations?
>>
>> For instance, if we had a read-only database on a mirror site, replicated
>> from the main database using something like Slony ... how hard would it be
>> t have 'write operations' sent to the main web site to happen, with all
>> read operations being local?
>
> Thinking about what it would take...
>
> We'd need the pg_hba.conf of the main database set to allow connections from
> the mirror website(s), so the write operations can occur.
>
> Or, perhaps as an alternative, we could look at making the pages that
> generate writes only be on the main PG website.  So, the majority of content
> is mirrored except for a few pages which do stuff like (i.e.) submit new
> stories and stuff.

This second was what I was thinking ...

> Yep, should be possible.  We just have to think about the technology
> we'd like web mirrors to run, and then ensure it's acceptable and
> do-able.

Now, knowing that all mirrors couldn't do this (or wouldn't), I was
thinking of having a pseudo-regional master mirror that others could rsync
static content from ...

----
Marc G. Fournier           Hub.Org Networking Services (http://www.hub.org)
Email: scrappy@hub.org           Yahoo!: yscrappy              ICQ: 7615664

Re: Distributed Database Web Site

From
"Dave Page"
Date:


-----Original Message-----
From: pgsql-www-owner@postgresql.org on behalf of Marc G. Fournier
Sent: Sun 8/15/2004 4:50 PM
To: Justin Clift
Cc: Marc G. Fournier; pgsql-www@postgresql.org
Subject: Re: [pgsql-www] Distributed Database Web Site

> Now, knowing that all mirrors couldn't do this (or wouldn't), I was
> thinking of having a pseudo-regional master mirror that others could rsync
> static content from ...

What's the point? The main site uses a trivial amount of database access anyway, so unless you wanted to hack gforge
forreplication/static content mirroring... 

Regards, Dave

Re: Distributed Database Web Site

From
Alexey Borzov
Date:
Hi,

Marc G. Fournier wrote:
> For instance, if we had a read-only database on a mirror site,
> replicated from the main database using something like Slony ... how
> hard would it be t have 'write operations' sent to the main web site to
> happen, with all read operations being local?

What's the point? You can't realistically expect permanent high-speed
connectivity between master and slaves, thus replication will be *extremely*
asynchronous.

The only obviuos benefit I see is reduced traffic.

> ie. posting news events would happen at http://www.postgresql.org, but
> reading news events would be @ http://www.xx.postgresql.org, but both
> could/would be dynamic?

It works this way even now.