Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id C10589FC059 for ; Wed, 8 Aug 2007 10:17:10 -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 31340-02-2 for ; Wed, 8 Aug 2007 10:16:54 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from s15216962.onlinehome-server.info (s15216962.onlinehome-server.info [217.160.22.205]) by postgresql.org (Postfix) with ESMTP id BDBE99FC052 for ; Wed, 8 Aug 2007 10:17:01 -0300 (ADT) Received: (from uucp@localhost) by s15216962.onlinehome-server.info (8.13.3/8.13.3) with UUCP id l78DH82o020020 for pgsql-sql@postgresql.org; Wed, 8 Aug 2007 15:17:08 +0200 Received: (from weigelt@localhost) by nibiru.metux.de (8.12.10/8.12.10) id l78DFqv4012718 for pgsql-sql@postgresql.org; Wed, 8 Aug 2007 15:15:52 +0200 Date: Wed, 8 Aug 2007 15:15:52 +0200 From: Enrico Weigelt To: pgsql-sql Subject: Re: Database synchronization Message-ID: <20070808131552.GD27936@nibiru.local> Reply-To: weigelt@metux.de References: <20070724143737.GA25948@apartia.fr> <004e01c7cea4$58046570$080d3050$@com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <004e01c7cea4$58046570$080d3050$@com> User-Agent: Mutt/1.4.1i X-Terror: bin laden, kill bush, Briefbombe, Massenvernichtung, KZ, X-Nazi: Weisse Rasse, Hitlers Wiederauferstehung, 42, X-Antichrist: weg mit schaeuble, ausrotten, heiliger krieg, al quaida, X-Killer: 23, endloesung, Weltuntergang, X-Doof: wer das liest ist doof X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200708/51 X-Sequence-Number: 28989 * Jyoti Seth wrote: Hi, if you can live with some seconds lag, you can use an separate transfer process which looks at the source of your prices and and updates the second DB if some price changes. Depending on how often prices change, there're two good options: a) add an timestamp field to the original price table, which is maintained by an after-trigger. The transfer regularily (ie. every few secs) fetches all those records which have been changed since last poll (via the new timestamp field). b) create an new table for an journal of the price changes. this journal is filled by rules on the original table and contains exactly what's needed to reproduce the price changes in the other DB. The transfer process regularily fetches the journal and rolls it out in the second DB. I've implemented the method b) in an realtime stock (FOREX) trading applications where trading automatically robots execute transactions on the customer's broker accounts on signals provided by an team of profession traders. (the client can subscribe to several trading signal channels and define in which quantities transactions should be performed from which channels should be executed on their broker accounts and the broking platform does all the time critical work). The robots work entirely on separate databases (on separate hosts), several transfer processes feed in robot commands and fetch back results to the primary database. So time critical things are separated to own servers. It works quite fine :) cu -- --------------------------------------------------------------------- Enrico Weigelt == metux IT service - http://www.metux.de/ --------------------------------------------------------------------- Please visit the OpenSource QM Taskforce: http://wiki.metux.de/public/OpenSource_QM_Taskforce Patches / Fixes for a lot dozens of packages in dozens of versions: http://patches.metux.de/ ---------------------------------------------------------------------