X-Original-To: pgsql-sql@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 249AD475B07 for ; Wed, 26 Feb 2003 10:56:34 -0500 (EST) Received: from postgresql.org ([64.49.215.8]) by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with SMTP id 79598-06 for ; Wed, 26 Feb 2003 10:56:23 -0500 (EST) Received: from matrix.gatewaynet.com (unknown [217.19.69.50]) by postgresql.org (Postfix) with ESMTP id 0230747580B for ; Wed, 26 Feb 2003 10:53:05 -0500 (EST) Received: from matrix.gatewaynet.com (matrix.gatewaynet.com [217.19.69.50] (may be forged)) by matrix.gatewaynet.com (8.12.5/8.12.5) with ESMTP id h1QJwNIs018700; Wed, 26 Feb 2003 17:58:23 -0200 Received: from localhost (achill@localhost) by matrix.gatewaynet.com (8.12.5/8.12.5/Submit) with ESMTP id h1QJwNsA018696; Wed, 26 Feb 2003 17:58:23 -0200 Date: Wed, 26 Feb 2003 17:58:23 -0200 (GMT+2) From: Achilleus Mantzios To: george young Cc: pgsql-sql@postgresql.org Subject: Re: Design Q.:logic in app or db? In-Reply-To: <20030226103220.6875cee9.gry@ll.mit.edu> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new X-Archive-Number: 200302/583 X-Sequence-Number: 11981 On Wed, 26 Feb 2003, george young wrote: > I have general design question about Postgres usage: How does one decide > how much, and what parts of logic should go in DB rules, triggers, > functions, constraints etc, versus what should go in the application? > > I see postings here from people who obviously have a lot of domain > logic in the DB side. I currently have almost none. I plan to set up > a bunch of RI constraints to keep things clean and consistant, but what > about logic that implements frequent domain operations? > > Brief sketch of my project: 2 developers, 4k lines of python(gtk, pygres), > 2 main GUI user apps and a few read-only scripts for web display, > 50 concurrent users(all local), DB performance important but not currently > a problem. > > The main thing not done yet is to facilitate ad-hoc queries > (via odbc excel etc.) from db-naive users: maybe restructuring the > db to make it simpler, maybe views and functions... The data is > somewhat complex in structure. If your column names make sense you could expose table's structure using metadata of your favorite driver or direct sql calls to system tables. Also you could install a search engine on your site, and have all these "adhoc" queries predone and indexed. > > -- George > -- > I cannot think why the whole bed of the ocean is > not one solid mass of oysters, so prolific they seem. Ah, > I am wandering! Strange how the brain controls the brain! > -- Sherlock Holmes in "The Dying Detective" > > ---------------------------(end of broadcast)--------------------------- > TIP 4: Don't 'kill -9' the postmaster > ================================================================== Achilleus Mantzios S/W Engineer IT dept Dynacom Tankers Mngmt Nikis 4, Glyfada Athens 16610 Greece tel: +30-10-8981112 fax: +30-10-8981877 email: achill@matrix.gatewaynet.com mantzios@softlab.ece.ntua.gr