Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 2EDA49FB64A for ; Wed, 25 Jul 2007 07:43:44 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 31283-10 for ; Wed, 25 Jul 2007 07:43:34 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from nz-out-0506.google.com (nz-out-0506.google.com [64.233.162.238]) by postgresql.org (Postfix) with ESMTP id 9D99D9FB616 for ; Wed, 25 Jul 2007 07:43:40 -0300 (ADT) Received: by nz-out-0506.google.com with SMTP id l8so120738nzf for ; Wed, 25 Jul 2007 03:43:39 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:from:to:cc:references:in-reply-to:subject:date:message-id:mime-version:content-type:content-transfer-encoding:x-mailer:thread-index:content-language; b=Z3CPZhGsqY3c1nH8PRIEtnxWDw5CghOdrrSjwnevXYbTvX2GHxrp+bYpYn9B8SN5H4RaseRS7ljL5u7gfCqL2GhujPQArqXKLoCVdGW2mEA5Y9hlTla42igto4VCSbNMZ2OnXgWZZ84hp5nKZPtkHfpK+OR7U0XDL4xqZAsSEks= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:from:to:cc:references:in-reply-to:subject:date:message-id:mime-version:content-type:content-transfer-encoding:x-mailer:thread-index:content-language; b=qKVsM3MomkMw3F0F5MkLFw0XbWUWHph6+pN1uKzv/85wGqNGdpPnLZHeHU4slJ2eEwUCEHcWZ0M4uLuHllUZe18Kj39kRQpMpptPx+zZ2nbCmaPWJa/f/LUBGfz6cuY49XSd+IHqShU1cJCTxAAXWF07gzbzzDgIg27JKav+QQw= Received: by 10.141.197.18 with SMTP id z18mr150853rvp.1185360218813; Wed, 25 Jul 2007 03:43:38 -0700 (PDT) Received: from bitdldt04 ( [122.162.169.176]) by mx.google.com with ESMTPS id l38sm874315rvb.2007.07.25.03.43.35 (version=SSLv3 cipher=RC4-MD5); Wed, 25 Jul 2007 03:43:37 -0700 (PDT) From: "Jyoti Seth" To: "'Richard Huxton'" Cc: References: <20070724143737.GA25948@apartia.fr> <004e01c7cea4$58046570$080d3050$@com> <46A724CB.3030405@archonet.com> In-Reply-To: <46A724CB.3030405@archonet.com> Subject: Re: Database synchronization Date: Wed, 25 Jul 2007 16:10:27 +0530 Message-ID: <000001c7cea8$39775d20$ac661760$@com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcfOpfIZ1Px6iZaGRzeHppFRZ/5KsgAAA6Ww Content-Language: en-us X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200707/145 X-Sequence-Number: 28880 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