X-Original-To: pgsql-hackers-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 051A09FB26A for ; Tue, 8 Aug 2006 18:52:11 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 48764-03 for ; Tue, 8 Aug 2006 18:52:07 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from dcs.lsd.di.uminho.pt (linux.di.uminho.pt [193.136.19.96]) by postgresql.org (Postfix) with ESMTP id 7FD9E9FB266 for ; Tue, 8 Aug 2006 18:52:06 -0300 (ADT) Received: (qmail 17964 invoked by uid 89); 8 Aug 2006 22:10:30 -0000 Received: from unknown (HELO localhost.localdomain) (192.168.82.189) by dcs.lsd.di.uminho.pt with SMTP; 8 Aug 2006 22:10:30 -0000 From: Jose Orlando Pereira Organization: http://gsd.di.uminho.pt/members/jop To: pgsql-hackers@postgresql.org Subject: Re: standard interfaces for replication providers Date: Tue, 8 Aug 2006 22:48:01 +0100 User-Agent: KMail/1.9.3 Cc: Christopher Browne References: <44D30B31.2070403@lsd.di.uminho.pt> <44D89EA5.5090703@bluegap.ch> <87irl3uqgx.fsf@wolfe.cbbrowne.com> In-Reply-To: <87irl3uqgx.fsf@wolfe.cbbrowne.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200608082248.01322.jop@lsd.di.uminho.pt> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.72 tagged_above=0 required=5 tests=SARE_SPEC_REPLICA X-Spam-Level: X-Archive-Number: 200608/511 X-Sequence-Number: 88004 On Tuesday 08 August 2006 17:44, Christopher Browne wrote: > Most databases that are interesting to replicate are implemented in C > or C++, thereby implying that a suitably "deep" API needs to be > implemented in C. > > In the case of PostgresQL, at least, operating in Java means that you > need to operate at "arms length" from the database, which means the > replication system is by no means tightly integrated. Yes, PostgreSQL is the tough one here. Having a single-process multithreaded PostgreSQL in which PL/Java would run in one global JVM would sure feel like Christmas! ;) Note however that the problem is not Java, but any package that does not expect the current PostgreSQL concurrency model. AFAIK Postgres-R has same "arms length" architecture with an external process, probably for compatibility with Spread. We have however tried to minimize the inconvenience, even for PostgreSQL, by doing the following: 1. Implementation was done in two layers, in which the PostgreSQL-specific one is 100% Java-free and feature complete. 2. High level functionality (i.e. transaction priorities instead of directly handling individual lock operations) reduce the number of round-trips to the replication process. 3. Event listeners in Java can be registered as non-blocking, thus putting the external JVM out of the critical path except in a few critical operations. Finally, although I concede that most databases that are interesting to replicate are written in C or C++, these days, most are also getting tightly coupled JVMs fairly high in their feature lists. -- Jose Orlando Pereira