Replication & web apps

From: Leonardo Francalanci <Leonardo(dot)Francalanci(at)CommProve(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Replication & web apps
Date: 2006-03-16 10:33:34
Message-ID: 44193EFE.3020200@CommProve.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

I still don't understand how replication can be used in web applications.
Given this scenario:

1) user updates his profile -> update to the db (master)
2) web app redirects to the "profile page" -> select from db (slave)

Since (2) is a select it is issued to the slave.

How can one be sure that the master propagates the update (1) to the
slave before data is requested from the slave (2)?
And: suppose there is a method to understand that the user made a change
to the db in the web request (as above) so that we have to issue all
queries of the same web request to the master, that is:

1) user updates his profile -> update to the db (master)
2) web app redirects to the "profile page" -> select from db (master
again because in this web-request user made a change to the db)

what if the user ask AGAIN for the "profile page" BEFORE write
propagates to the slave:

3) User ask for a refresh of the "profile page" -> select -> slave
(because user didn't make any change during THIS web request)

???

In other words: how can asynchronous replication be used in an
application???

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ets ROLLAND 2006-03-16 11:04:07 Pb d'installation de postgreSQL 8.1.3-1 win32
Previous Message Harald Armin Massa 2006-03-16 10:15:06 picking the correct locale when doing initdb