Re: Replication & web apps - Mailing list pgsql-general

From Christopher Browne
Subject Re: Replication & web apps
Date
Msg-id 87ek11rcgj.fsf@wolfe.cbbrowne.com
Whole thread Raw
In response to Replication & web apps  (Leonardo Francalanci <Leonardo.Francalanci@CommProve.com>)
List pgsql-general
In the last exciting episode, Leonardo.Francalanci@CommProve.com (Leonardo Francalanci) wrote:
> In other words: how can asynchronous replication be used in an
> application???

Yes, this is an issue.

Asynchronous replication is NOT suitable in cases where you point
applications that need forcibly up-to-date information to a replica
that is (even just a little) behind.

We *have to* point all of the applications that need
up-to-the-instance balance information to the "master" system.

But there are doubtless plenty of places where you could use data that
isn't *forcibly* up to date.

- For instance, running temporal reports against a replica should turn
  out fine.

- We run the WHOIS service against replicas; we don't promise
  instantaneous propagation, and nobody worries too much if they get
  information that, in a few cases, is a few seconds out of date.

- In a web sales system, I'd be inclined to run "normal" queries
  against a replica for the portion of the workflow that involves
  users assembling their "basket" of products.  And move to
  pointing to the "master" when it comes time to "check out" the
  order, so that the final order gets the most up-to-date data.

Asynchronous replication isn't good for *everything*, but you'll
generally find ways to use replicas, when you have them...
--
let name="cbbrowne" and tld="ntlug.org" in String.concat "@" [name;tld];;
http://linuxfinances.info/info/lsf.html
"The best  design is not predicated  on how brain-dead you  can be and
still operate it." -- David C. Wright

pgsql-general by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: How do I make a timestamp column default to current time
Next
From: Oleg Bartunov
Date:
Subject: Re: full text indexing