pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jyoti Seth <jyotiseth2001@gmail.com>
To: 'Richard Huxton' <dev@archonet.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Database synchronization
Date: Wed, 25 Jul 2007 16:10:27 +0530
Message-ID: <000001c7cea8$39775d20$ac661760$@com> (raw)
In-Reply-To: <46A724CB.3030405@archonet.com>
References: <20070724143737.GA25948@apartia.fr>
	<004e01c7cea4$58046570$080d3050$@com>
	<46A724CB.3030405@archonet.com>

My master database contains prices of some products that vary after few
hours and many other details that are also reqd in Db2 which doesn't change
that frequently. My slave database contains the details of queries sent by
the customers.
These queries are to find the price of the product and other details. (Some
part of the info reqd from Db1 varies frequently where some information is a
kind of master data that doesn't vary frequently).

So should I use all the ways i.e #2 or #3 to get price info and #1 (slony)
for other details or there is some other better option

Thanks,
Jyoti

-----Original Message-----
From: Richard Huxton [mailto:dev@archonet.com] 
Sent: Wednesday, July 25, 2007 3:54 PM
To: Jyoti Seth
Cc: pgsql-sql@postgresql.org
Subject: Re: [SQL] Database synchronization

Try not to start a new thread (question) by replying to an old one - it 
can mean some people don't see your question.

I will take care in future.

Jyoti Seth wrote:
> Hi,
> 
> I have two postgres databases "Db1" and "Db2" on different linux servers.
> "DB1" is my master server and its data updates very frequently.
> 
> My application access DB2 database, which in turn requires data from Db1
> database. 

OK

> The same can be achieved in either of the following ways:
> 1. I can have the same tables from Db1 in the Db2 database and use some
> replication process to update these tables say using Slony-I. And then our
> application accesses the data from the single database.

Yes

> 2. Or I can use dblink to fetch the data from the master database only.

Yes

also:

3. Write a layer in your application / between the application & 
database which routes queries to the correct database.

> My problem is my master database changes frequently and I always require
the
> latest information.

Well, if by "latest" you mean you can't have any delay at all you'll 
have to use #2 or #3.

However, that could be slow if you need to join a lot of data from DB1 
to DB2. Can you provide more details of what each contains?

-- 
   Richard Huxton
   Archonet Ltd




view thread (17+ messages)  latest in thread

Message-ID: <000001c7cea8$39775d20$ac661760$@com>
Permalink:  ../000001c7cea8$39775d20$ac661760$@com/
Also on:    postgresql.org/message-id/000001c7cea8$39775d20$ac661760$@com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: jyotiseth2001@gmail.com, dev@archonet.com
  Subject: Re: Database synchronization
  In-Reply-To: <000001c7cea8$39775d20$ac661760$@com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox