Skip site navigation (1) Skip section navigation (2)

Re: Replication and coding good practices

From: David Fetter <david(at)fetter(dot)org>
To: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
Cc: Ivan Sergio Borgonovo <mail(at)webthatworks(dot)it>,"pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Replication and coding good practices
Date: 2009-06-29 14:34:49
Message-ID: 20090629143449.GY21081@fetter.org (view raw or flat)
Thread:
Lists: pgsql-general
On Mon, Jun 29, 2009 at 07:11:43PM +0800, Craig Ringer wrote:
> On Sun, 2009-06-28 at 09:01 -0700, David Fetter wrote:
> > > Are there any rules of thumb to consider for making an application
> > > easier to work with a "general" replication solution?
> > > 
> > > The applications I mostly deal with are e-commerce sites.
> > 
> > It really depends on what replication solution you choose, along with
> > the environment you're deploying into.
> 
> ... and why you need replication. Reliability/Availability? Data storage
> redundancy? Performance? And if performance, read-mostly performance or
> write-heavy performance?

It's this kind of discussion that you might want to hire experts to
help with :)  Commandprompt, Endpoint, OmniTI and the outfit I work
for, PostgreSQL Experts <http://www.pgexperts.com> would be examples.

> > That said, I've noticed that the things that are generally good
> > practice help you even more when you're doing replication.
> > 
> > Practices I've seen help directly:
> > 
> > * Separate read users and code from write users and code.
> > 
> > * Separate DDL from both of the above.
> > 
> > * Make DDL changes part of your deployment process and only allow them
> >   in files which track in your SCM system.
> 
> Version your schema, storing the schema version in a 1-row table or
> even as a stable function.  This makes it much easier for deployment
> tools or staff to easily see what needs to be done to get the schema
> and app to the latest version - there's no "what the hell is the
> current state of this thing, anyway?"  to worry about.

When versioning schemas, make sure your deployment tools are always
atomic and that the schema version can't be modified by anything but
those tools.

Cheers,
David.
-- 
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778  AIM: dfetter666  Yahoo!: dfetter
Skype: davidfetter      XMPP: david(dot)fetter(at)gmail(dot)com

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

In response to

Responses

pgsql-general by date

Next:From: Pedro Doria MeunierDate: 2009-06-29 14:40:54
Subject: Re: Slony-I timezone setting
Previous:From: Joshua TolleyDate: 2009-06-29 14:22:08
Subject: Re: Free OLAP software for Postgres databas

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group