Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 66C5CB5DBD5 for ; Mon, 15 Aug 2011 21:06:38 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 26270-06 for ; Tue, 16 Aug 2011 00:06:31 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-vx0-f174.google.com (mail-vx0-f174.google.com [209.85.220.174]) by mail.postgresql.org (Postfix) with ESMTP id A2D2AB5DC0A for ; Mon, 15 Aug 2011 21:06:30 -0300 (ADT) Received: by vxi9 with SMTP id 9so4274383vxi.19 for ; Mon, 15 Aug 2011 17:06:29 -0700 (PDT) Received: by 10.52.89.110 with SMTP id bn14mr4561711vdb.26.1313453189632; Mon, 15 Aug 2011 17:06:29 -0700 (PDT) Received: from [10.1.1.8] (124-169-181-228.dyn.iinet.net.au [124.169.181.228]) by mx.google.com with ESMTPS id o18sm2843786vcu.4.2011.08.15.17.06.27 (version=SSLv3 cipher=OTHER); Mon, 15 Aug 2011 17:06:29 -0700 (PDT) Message-ID: <4E49B47E.8020401@ringerc.id.au> Date: Tue, 16 Aug 2011 08:06:22 +0800 From: Craig Ringer User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:5.0) Gecko/20110624 Thunderbird/5.0 MIME-Version: 1.0 To: Merlin Moncure CC: Andreas Joseph Krogh , pgsql-general@postgresql.org Subject: Re: Using Postgresql as application server References: <4E46D0D7.3090700@officenet.no> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-5 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201108/467 X-Sequence-Number: 178749 On 15/08/2011 10:36 PM, Merlin Moncure wrote: > On Sat, Aug 13, 2011 at 2:30 PM, Andreas Joseph Krogh > wrote: >> No, PG has never, and will never, act as an application-server. > Why in the world not? The biggest reason is safety. Beyond that, the lack of autonomous transactions, stored procedures, in-DB timers, and support for any protocol other than the native Pg database query protocol mean it's also rather impractical. I guess theoretically one could embed a JVM / Python instance / whatever in the postmaster and have it spawn new backends for incoming connections with other protocols. But ... why? Why add all that complexity and - more importantly - contaiminate PostgreSQL's address space with more code that can fail when you don't have to? PLs and user C procedures are already risk enough as far as I'm concerned. I *like* the DB being standalone. It's safer from bad code scribbling garbage across the heap and corrupting shared memory. What do you gain by trying to make Pg play appserver too? Now, I have nothing against keeping business logic in the DB. This makes a lot of sense to me, though it'd be better if it were easier to version DB changes. What I don't get is having the client access front-end in the DB too ... that just seems like asking for trouble and security problems. > Postgresql has certain features, in particular being able to implement > functions in any language, that make it uniquely well suited among its > peers to act as a application server platform. Actually, I'd say Oracle's really solid Java support, in-db timers, and autonomous transactions makes it rather better suited. -- Craig Ringer