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